[Python-checkins] gh-104036: Fix direct invocation of test_typing (#104037)

AlexWaygood webhook-mailer at python.org
Mon May 1 09:43:06 EDT 2023


https://github.com/python/cpython/commit/4181d078fc945313568eb39965cb9190881606b5
commit: 4181d078fc945313568eb39965cb9190881606b5
branch: main
author: Kirill Podoprigora <80244920+Eclips4 at users.noreply.github.com>
committer: AlexWaygood <Alex.Waygood at Gmail.com>
date: 2023-05-01T13:42:59Z
summary:

gh-104036: Fix direct invocation of test_typing (#104037)

Previously, `python -m test test_typing` worked, but `python Lib/test/test_typing.py` did not.

files:
M Lib/test/test_typing.py

diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index f36bb958c88e..7c6a521c3c48 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -117,7 +117,7 @@ def test_repr(self):
         class Sub(Any): pass
         self.assertEqual(
             repr(Sub),
-            "<class 'test.test_typing.AnyTests.test_repr.<locals>.Sub'>",
+            f"<class '{__name__}.AnyTests.test_repr.<locals>.Sub'>",
         )
 
     def test_errors(self):



More information about the Python-checkins mailing list