mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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
This commit is contained in:
parent
7152f6d915
commit
e2942d073d
2 changed files with 27 additions and 4 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue