From: Serhiy Storchaka Date: Mon, 4 Sep 2023 16:41:42 +0000 (+0300) Subject: [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (#108871) X-Git-Tag: v3.12.0rc2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5c2d453fd264547f5f8be7c80fdb93e920d0093;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (#108871) * [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861). (cherry picked from commit d0b22f6bd84239e50b43709f98f2bb950222cfe5) Co-authored-by: Serhiy Storchaka * Add "import unittest". --- diff --git a/Lib/test/test_pep646_syntax.py b/Lib/test/test_pep646_syntax.py index 12a4227e4dc9..aac089b190bc 100644 --- a/Lib/test/test_pep646_syntax.py +++ b/Lib/test/test_pep646_syntax.py @@ -1,3 +1,6 @@ +import doctest +import unittest + doctests = """ Setup @@ -317,10 +320,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()