clone_test_with_new_id shares details dict between test case instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Fix Released
|
Low
|
Andrew Bennetts |
Bug Description
clone_test_
Unfortunately, the copy will share some attributes that should not be shared, especially __details and _cleanups.
In bzrlib's case this makes it difficult to read test failures when parameterised tests are involved — all parameterisations of a test share a details dict, so you might e.g. get 10 failing tests, each showing *10* tracebacks. In bzrlib's case it appears that a trivial __copy__ method that doesn't try to actually copy the instance but instead instantiates a new test case from scratch is an adequate workaround, but I'm not sure this is a good fix in general.
Perhaps clone_test_
Related branches
- testtools developers: Pending requested
-
Diff: 54 lines (+19/-1)2 files modifiedtesttools/testcase.py (+7/-1)
testtools/tests/test_testtools.py (+12/-0)
Changed in testtools: | |
status: | Triaged → Fix Committed |
assignee: | nobody → Andrew Bennetts (spiv) |
Changed in testtools: | |
milestone: | none → 0.9.7 |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
It can't merely be a method on TestCase, since we need to clone non-testtools TestCases. I like the other ideas though.