summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
authorCurtis Bucher <cpbucher5@gmail.com>2020-03-30 16:50:57 (GMT)
committerGitHub <noreply@github.com>2020-03-30 16:50:57 (GMT)
commit0c5ad5499798aed4cd305d324051986ed4c48c8c (patch)
tree0b3eed641af3e82e7f4ebaeb514bf0aba0970152 /Lib/test/test_collections.py
parent676b105111e2399ed400cd13ab113f9aa891760d (diff)
downloadcpython-0c5ad5499798aed4cd305d324051986ed4c48c8c.zip
cpython-0c5ad5499798aed4cd305d324051986ed4c48c8c.tar.gz
cpython-0c5ad5499798aed4cd305d324051986ed4c48c8c.tar.bz2
Fix bug in test_collections.py (#19221)
Test in TestChainMap() line 257 did not properly check union behavior.
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 47c500b..0207823 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -253,8 +253,9 @@ class TestChainMap(unittest.TestCase):
# testing behavior between chainmap and iterable key-value pairs
with self.assertRaises(TypeError):
cm3 | pairs
+ tmp = cm3.copy()
cm3 |= pairs
- self.assertEqual(cm3.maps, [cm3.maps[0] | dict(pairs), *cm3.maps[1:]])
+ self.assertEqual(cm3.maps, [tmp.maps[0] | dict(pairs), *tmp.maps[1:]])
# testing proper return types for ChainMap and it's subclasses
class Subclass(ChainMap):