TestWithScenarios doesn't set shortDescription()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testscenarios |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If I try to run my test suite using:
$ py -c "import sys; from testtools import run; import unittest; prog = run.TestProgram
(so force testtools.run to actually be verbose about the tests being run), I see odd behavior.
If I just inherit from TestCaseWithSce
test__sync_
test__sync_
test_create_index (u1db.tests.
test_create_index (u1db.tests.
...
If I change the code so that I inherit from testtools.TestCase, and I implement load_tests() as:
def load_tests(loader, standard_tests, pattern):
suite = loader.suiteClass()
suite.
return suite
I then see:
u1db.tests.
u1db.tests.
u1db.tests.
u1db.tests.
Even weirder, if I inherit directly from unittest.TestCase instead of testtools.TestCase, I see:
test__sync_
test__sync_
test_create_index (u1db.tests.
test_create_index (u1db.tests.
It looks like this is because unittest.
def getDescription(
if self.descriptions:
return test.shortDescr
else:
return str(test)
And the unittest.
So it looks like testscenarios.
I think inheriting from testtools.TestCase is reasonable, given that testscenarios already has a dependency on testtools.
summary: |
- TestWithScenarios doesn't seem to update .id() in time for - TextTestRunner + TestWithScenarios doesn't set shortDescription() |
description: | updated |
Changed in testscenarios: | |
status: | New → Incomplete |
what version of unittest are you using? e.g. do you have voidspaces new one? You may be affected by http:// code.google. com/p/unittest- ext/issues/ detail? id=72