File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -4391,19 +4391,19 @@ def blah():
4391
4391
4392
4392
blah ()
4393
4393
4394
- @patch ("typing._overload_registry" ,
4395
- defaultdict (lambda : defaultdict (dict )))
4396
4394
def test_overload_on_compiled_functions (self ):
4397
- # The registry starts out empty:
4398
- self .assertEqual (typing ._overload_registry , {})
4399
-
4400
- # This should just not fail:
4401
- overload (sum )
4402
- overload (print )
4403
-
4404
- # No overloads are recorded (but, it still has a side-effect):
4405
- self .assertEqual (typing .get_overloads (sum ), [])
4406
- self .assertEqual (typing .get_overloads (print ), [])
4395
+ with patch ("typing._overload_registry" ,
4396
+ defaultdict (lambda : defaultdict (dict ))):
4397
+ # The registry starts out empty:
4398
+ self .assertEqual (typing ._overload_registry , {})
4399
+
4400
+ # This should just not fail:
4401
+ overload (sum )
4402
+ overload (print )
4403
+
4404
+ # No overloads are recorded (but, it still has a side-effect):
4405
+ self .assertEqual (typing .get_overloads (sum ), [])
4406
+ self .assertEqual (typing .get_overloads (print ), [])
4407
4407
4408
4408
def set_up_overloads (self ):
4409
4409
def blah ():
You can’t perform that action at this time.
0 commit comments