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):
1968
1968
1969
1969
def test_nested_lookup_error (self ):
1970
1970
# 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' )
1972
1976
obj .__module__ = __name__
1973
1977
for proto in protocols :
1974
1978
with self .subTest (proto = proto ):
@@ -1983,9 +1987,11 @@ def test_nested_lookup_error(self):
1983
1987
1984
1988
def test_wrong_object_lookup_error (self ):
1985
1989
# Name is bound to different object
1986
- obj = REX ('AbstractPickleTests' )
1990
+ global TestGlobal
1991
+ class TestGlobal :
1992
+ pass
1993
+ obj = REX ('TestGlobal' )
1987
1994
obj .__module__ = __name__
1988
- AbstractPickleTests .ham = []
1989
1995
for proto in protocols :
1990
1996
with self .subTest (proto = proto ):
1991
1997
with self .assertRaises (pickle .PicklingError ):
You can’t perform that action at this time.
0 commit comments