diff options
| author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-04-02 05:51:54 (GMT) |
|---|---|---|
| committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-04-02 05:51:54 (GMT) |
| commit | e2942d073d4b8a1f9b5f48c73855f409e6b900b2 (patch) | |
| tree | 1649336e68d7b466e35528c8e191d40e6e3d7cd2 /Lib/test/test_unittest.py | |
| parent | 7152f6d9156a19a9f1b31e313d2c19d840dc089d (diff) | |
| download | cpython-e2942d073d4b8a1f9b5f48c73855f409e6b900b2.zip cpython-e2942d073d4b8a1f9b5f48c73855f409e6b900b2.tar.gz cpython-e2942d073d4b8a1f9b5f48c73855f409e6b900b2.tar.bz2 | |
Store the functions in the _type_equality_funcs as wrapped objects that are deep copyable.
This allows for the deep copying of TestCase instances.
Issue 5660
Diffstat (limited to 'Lib/test/test_unittest.py')
| -rw-r--r-- | Lib/test/test_unittest.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index c16327e..38c4f8f 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -11,6 +11,7 @@ from test import test_support import unittest from unittest import TestCase import types +from copy import deepcopy ### Support code ################################################################ @@ -2688,6 +2689,17 @@ test case self.failUnlessRaises(TypeError, lambda _: 3.14 + u'spam') self.failIf(False) + def testDeepcopy(self): + # Issue: 5660 + class TestableTest(TestCase): + def testNothing(self): + pass + + test = TestableTest('testNothing') + + # This shouldn't blow up + deepcopy(test) + class Test_TestSkipping(TestCase): |
