aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_typing.py
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2022-04-29 23:18:38 -0400
committerGitHub <noreply@github.com>2022-04-29 21:18:38 -0600
commita29aa76a3ff8e5a4ee85961bb37a163f6b75a034 (patch)
tree3a6a803ad722cc7dcc2e1d33a44d333a5289eaf1 /Lib/test/test_typing.py
parent2f7952c35b8fb2487cb9749081d2c0c604d41107 (diff)
downloadcpython-a29aa76a3ff8e5a4ee85961bb37a163f6b75a034.tar.gz
cpython-a29aa76a3ff8e5a4ee85961bb37a163f6b75a034.zip
gh-92064: Fix global variable name collision in test_typing (#92067)
Fixes #92064
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r--Lib/test/test_typing.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 929f0df960a..412d117c238 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -1332,16 +1332,16 @@ class TypeVarTuplePicklingTests(BaseTestCase):
@all_pickle_protocols
def test_pickling_then_unpickling_results_in_same_identity(self, proto):
- global Ts1 # See explanation at start of class.
- Ts1 = TypeVarTuple('Ts1')
- Ts2 = pickle.loads(pickle.dumps(Ts1, proto))
- self.assertIs(Ts1, Ts2)
+ global global_Ts1 # See explanation at start of class.
+ global_Ts1 = TypeVarTuple('global_Ts1')
+ global_Ts2 = pickle.loads(pickle.dumps(global_Ts1, proto))
+ self.assertIs(global_Ts1, global_Ts2)
@all_pickle_protocols
def test_pickling_then_unpickling_unpacked_results_in_same_identity(self, proto):
- global Ts # See explanation at start of class.
- Ts = TypeVarTuple('Ts')
- unpacked1 = Unpack[Ts]
+ global global_Ts # See explanation at start of class.
+ global_Ts = TypeVarTuple('global_Ts')
+ unpacked1 = Unpack[global_Ts]
unpacked2 = pickle.loads(pickle.dumps(unpacked1, proto))
self.assertIs(unpacked1, unpacked2)
@@ -1349,19 +1349,19 @@ class TypeVarTuplePicklingTests(BaseTestCase):
def test_pickling_then_unpickling_tuple_with_typevartuple_equality(
self, proto
):
- global T, Ts # See explanation at start of class.
- T = TypeVar('T')
- Ts = TypeVarTuple('Ts')
+ global global_T, global_Ts # See explanation at start of class.
+ global_T = TypeVar('global_T')
+ global_Ts = TypeVarTuple('global_Ts')
- a1 = Tuple[Unpack[Ts]]
+ a1 = Tuple[Unpack[global_Ts]]
a2 = pickle.loads(pickle.dumps(a1, proto))
self.assertEqual(a1, a2)
- a1 = Tuple[T, Unpack[Ts]]
+ a1 = Tuple[T, Unpack[global_Ts]]
a2 = pickle.loads(pickle.dumps(a1, proto))
self.assertEqual(a1, a2)
- a1 = Tuple[int, Unpack[Ts]]
+ a1 = Tuple[int, Unpack[global_Ts]]
a2 = pickle.loads(pickle.dumps(a1, proto))
self.assertEqual(a1, a2)