Skip to content

Commit f8b4624

Browse files
committed
Use run_code for the reproducer
1 parent 829f127 commit f8b4624

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎Lib/test/test_type_params.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,13 +933,15 @@ class Foo[__T, __U: __T](make_base(__T), make_base(lambda: __T)):
933933
def test_later_type_params_are_mangled(self):
934934
# gh-162597: a bound, constraint or default that refers to a later
935935
# private type parameter.
936-
class C[T: __U, __U]:
937-
pass
938-
class D[__U, T: __U]:
939-
pass
940-
T, U = C.__type_params__
936+
ns = run_code("""
937+
class C[T: __U, __U]:
938+
pass
939+
class D[__U, T: __U]:
940+
pass
941+
""")
942+
T, U = ns["C"].__type_params__
941943
self.assertIs(T.__bound__, U)
942-
U, T = D.__type_params__
944+
U, T = ns["D"].__type_params__
943945
self.assertIs(T.__bound__, U)
944946

945947
ns = run_code("""

0 commit comments

Comments
 (0)