Skip to content

Commit 6ecc628

Browse files
committed
Simplify the test
1 parent b909e49 commit 6ecc628

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/test/test_dict.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,19 +1792,16 @@ def test_fromkeys(self):
17921792
frozendict(a=None, b=None, c=None))
17931793

17941794
# Subclass which overrides the constructor
1795-
created = None
1795+
created = frozendict(x=1)
17961796
class FrozenDictSubclass(frozendict):
17971797
def __new__(self):
1798-
nonlocal created
1799-
created = frozendict(x=1)
18001798
return created
18011799

18021800
fd = FrozenDictSubclass.fromkeys("abc")
18031801
self.assertEqual(fd, frozendict(x=1, a=None, b=None, c=None))
18041802
self.assertEqual(type(fd), FrozenDictSubclass)
18051803
self.assertEqual(created, frozendict(x=1))
18061804

1807-
created = None
18081805
fd = FrozenDictSubclass.fromkeys(frozendict(y=2))
18091806
self.assertEqual(fd, frozendict(x=1, y=None))
18101807
self.assertEqual(type(fd), FrozenDictSubclass)

0 commit comments

Comments
 (0)