File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1968,7 +1968,11 @@ def test_nonencodable_module_name_error(self):
19681968
19691969 def test_nested_lookup_error (self ):
19701970 # Nested name does not exist
1971- obj = REX ('AbstractPickleTests.spam' )
1971+ global TestGlobal
1972+ class TestGlobal :
1973+ class A :
1974+ pass
1975+ obj = REX ('TestGlobal.A.B.C' )
19721976 obj .__module__ = __name__
19731977 for proto in protocols :
19741978 with self .subTest (proto = proto ):
@@ -1983,9 +1987,11 @@ def test_nested_lookup_error(self):
19831987
19841988 def test_wrong_object_lookup_error (self ):
19851989 # Name is bound to different object
1986- obj = REX ('AbstractPickleTests' )
1990+ global TestGlobal
1991+ class TestGlobal :
1992+ pass
1993+ obj = REX ('TestGlobal' )
19871994 obj .__module__ = __name__
1988- AbstractPickleTests .ham = []
19891995 for proto in protocols :
19901996 with self .subTest (proto = proto ):
19911997 with self .assertRaises (pickle .PicklingError ):
You can’t perform that action at this time.
0 commit comments