summaryrefslogtreecommitdiff
path: root/Lib/test/test_copy.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-30 17:20:02 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-30 17:20:02 +0200
commitcbbec1c53f4b6fb88b4ae984e69db2d2951cd560 (patch)
treedbeedc92a40ef0f47f106cdae19d0aab55dbd83a /Lib/test/test_copy.py
parent7279befccbd49fc6aa2f96c4b0dea1799695156d (diff)
downloadcpython-git-cbbec1c53f4b6fb88b4ae984e69db2d2951cd560.tar.gz
Issue #25718: Fixed copying object with state with boolean value is false.
Diffstat (limited to 'Lib/test/test_copy.py')
-rw-r--r--Lib/test/test_copy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index eb8d18cf0b..0c5354c65c 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -180,6 +180,9 @@ class TestCopy(unittest.TestCase):
return self.foo == other.foo
x = C(42)
self.assertEqual(copy.copy(x), x)
+ # State with boolean value is false (issue #25718)
+ x = C(0.0)
+ self.assertEqual(copy.copy(x), x)
# The deepcopy() method
@@ -448,6 +451,12 @@ class TestCopy(unittest.TestCase):
self.assertEqual(y, x)
self.assertIsNot(y, x)
self.assertIsNot(y.foo, x.foo)
+ # State with boolean value is false (issue #25718)
+ x = C([])
+ y = copy.deepcopy(x)
+ self.assertEqual(y, x)
+ self.assertIsNot(y, x)
+ self.assertIsNot(y.foo, x.foo)
def test_deepcopy_reflexive_inst(self):
class C: