mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix bug in test_collections.py (#19221)
Test in TestChainMap() line 257 did not properly check union behavior.
This commit is contained in:
parent
676b105111
commit
0c5ad54997
1 changed files with 2 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue