testtools.skip decorator not functional with unittest.TestCase as base class
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | testtools |
Medium
|
Unassigned | ||
Bug Description
This may or may not be a bug, but its certainly a change in behaviour between versions of testtools/
testtools: 1.4.0
unittest2: 0.8.0
Inheritance chain: AppsTest -> ScopeHarnessTes
AppsTest uses the skip decorator:
class AppsTest (ScopeHarnessTe
@testtools.
def setUp(self):
Results in an ERROR:
=======
ERROR: tests.test_
-------
Traceback (most recent call last):
unittest2.
switching the base class to testtools.TestCase resolves the problem, and looks more consistent.
| James Page (james-page) wrote : | #1 |
| dobey (dobey) wrote : | #2 |
This seems to only be an issue when the skip is a decorator on the setUp() method. Having it be a decorator on individual tests seems to work fine.
| Jonathan Lange (jml) wrote : | #3 |
Minimal example:
import unittest
from testtools import skip
class FooTests(
@skip('Ha!')
def setUp(self):
pass
def test_foo(self):
pass
unittest.main()
Can confirm is still a problem in master.
| Changed in testtools: | |
| status: | New → Triaged |
| importance: | Undecided → Medium |

For reference, these tests passed OK with:
testtools: 0.9.39
unittest2: 0.5.1