Issue #21741: Update 147 test modules to use test discovery.
I have compared output between pre- and post-patch runs of these tests
to make sure there's nothing missing and nothing broken, on both
Windows and Linux. The only differences I found were actually tests
that were previously *not* run.
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 7069fb9..0c65858 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -1,7 +1,7 @@
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
-from test.support import run_unittest, check_syntax_error
+from test.support import check_syntax_error
import unittest
import sys
# testing import *
@@ -1031,8 +1031,5 @@
self.assertEqual(m.other, 42)
-def test_main():
- run_unittest(TokenTests, GrammarTests)
-
if __name__ == '__main__':
- test_main()
+ unittest.main()