[Python-checkins] Fix bug in test_collections.py (#19221)

Curtis Bucher webhook-mailer at python.org
Mon Mar 30 12:51:05 EDT 2020


https://github.com/python/cpython/commit/0c5ad5499798aed4cd305d324051986ed4c48c8c
commit: 0c5ad5499798aed4cd305d324051986ed4c48c8c
branch: master
author: Curtis Bucher <cpbucher5 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020年03月30日T09:50:57-07:00
summary:
Fix bug in test_collections.py (#19221)
Test in TestChainMap() line 257 did not properly check union behavior.
files:
M Lib/test/test_collections.py
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 47c500bcdd002..0207823f5aab7 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -253,8 +253,9 @@ def test_union_operators(self):
 # 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):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /