testtools details should not be shared between parameterised tests

Bug #625574 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Andrew Bennetts

Bug Description

Since selftest started depending on testtools, parameterised tests have been sharing their 'details', the new testtools api for things like the log, traceback, skip reason, and so on. This is mostly unnoticed as each test will overwrite the previous attributes, but when Robert added multiple traceback recording, some tests now grow a new traceback each time a test fails. Other symptoms are also possible, like passing tests inheriting spurious details from earlier skipped or failing tests.

Robert suggested that the (shallow) copy.copy in bzrlib.tests.clone_test is the root cause, but possibly this wants something changing in testtools as well. Other TestCase attributes like the cleanups list also should also not be shared between instances.

This problem is incidentally, and accidentally, worked around in the lp:~gz/bzr/cleanup_testcases_by_collection_613247 branch as I needed to clear the details to break a cycle.

Related branches

Revision history for this message
Martin Packman (gz) wrote :
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Packman (gz) wrote :

Addressed by lp:~spiv/bzr/traceback-accumulation-2.2 for bzrlib, and bug 637725 filed against testtools.

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
status: Confirmed → In Progress
Revision history for this message
Andrew Bennetts (spiv) wrote :

Ok, finally, I think a tasteful and safe workaround has landed in lp:bzr and lp:bzr/2.2. I've also submitted a patch to fix it in testtools.

Changed in bzr:
milestone: none → 2.3b1
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.