change deepcopy to copy

Bug #498869 reported by Robert Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Medium
Robert Collins

Bug Description

using testresources with testscenarios will prevent optimisation of test suites due to resources being deepcopied rather than referenced.

I think we should switch to shallow copying, by default, allowing folk to implement __deepcopy__ if they have a need for that.

My rationale:
 - our tests, and test API encourages setUp to be used to add state, not __init__; the few things we encourage using __init__ for take regular functions or attribute names, not bound methods.
 - deep copy is surprising and actually quite buggy: 2.4 cannot deep copy functions or method instances; only 2.7 and above can copy method instances. When converting bzrlib to use testtools as a base, I experimented with deepcopy, and it broke lots of things.

I argue that this is a defect in our current clone support, so making it medium.

Related branches

Changed in testtools:
status: Triaged → Fix Released
assignee: nobody → Robert Collins (lifeless)
milestone: none → next
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.