Skip to content

Commit 3e33040

Browse files
committed
Reuse one instance of test class
1 parent 6390a82 commit 3e33040

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_functools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,9 +2927,10 @@ def for_set(self, arg: set, arg2: None):
29272927
def for_complex(self: object, arg: complex, arg2: None):
29282928
return "complex"
29292929

2930-
t.register(SomeClass().for_dict)
2931-
t.register(SomeClass().for_set)
2932-
t.register(SomeClass().for_complex)
2930+
inst = SomeClass()
2931+
t.register(inst.for_dict)
2932+
t.register(inst.for_set)
2933+
t.register(inst.for_complex)
29332934

29342935
self.assertEqual(t(0), "int")
29352936
self.assertEqual(t(''), "str")

0 commit comments

Comments
 (0)