From d0b22f6bd84239e50b43709f98f2bb950222cfe5 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 4 Sep 2023 12:41:58 +0300 Subject: [PATCH] gh-89392: Make test_pep646_syntax discoverable (GH-108861) --- Lib/test/test_pep646_syntax.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_pep646_syntax.py b/Lib/test/test_pep646_syntax.py index 12a4227e4dc..def313da89a 100644 --- a/Lib/test/test_pep646_syntax.py +++ b/Lib/test/test_pep646_syntax.py @@ -1,3 +1,5 @@ +import doctest + doctests = """ Setup @@ -317,10 +319,10 @@ is *not* valid syntax.) __test__ = {'doctests' : doctests} -def test_main(verbose=False): - from test import support - from test import test_pep646_syntax - return support.run_doctest(test_pep646_syntax, verbose) +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite()) + return tests + if __name__ == "__main__": - test_main(verbose=True) + unittest.main()