diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/libregrtest/main.py | 2 | ||||
-rw-r--r-- | Lib/test/support/__init__.py | 6 | ||||
-rw-r--r-- | Lib/test/test_asyncore.py | 3 | ||||
-rw-r--r-- | Lib/test/test_gdb.py | 1 | ||||
-rw-r--r-- | Lib/test/test_multiprocessing_fork.py | 6 | ||||
-rw-r--r-- | Lib/test/test_multiprocessing_forkserver.py | 5 | ||||
-rw-r--r-- | Lib/test/test_multiprocessing_main_handling.py | 3 | ||||
-rw-r--r-- | Lib/test/test_multiprocessing_spawn.py | 5 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 3 |
9 files changed, 33 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index ba9e48b4486..dbbf72f1b5a 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -473,6 +473,8 @@ class Regrtest: if self.ns.wait: input("Press any key to continue...") + support.PGO = self.ns.pgo + setup_tests(self.ns) self.find_tests(tests) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 4a7cd40a0f9..3e2ab43ca4c 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -105,7 +105,7 @@ __all__ = [ "check_warnings", "check_no_resource_warning", "EnvironmentVarGuard", "run_with_locale", "swap_item", "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict", - "run_with_tz", + "run_with_tz", "PGO", ] class Error(Exception): @@ -878,6 +878,10 @@ else: # Save the initial cwd SAVEDCWD = os.getcwd() +# Set by libregrtest/main.py so we can skip tests that are not +# useful for PGO +PGO = False + @contextlib.contextmanager def temp_dir(path=None, quiet=False): """Return a context manager that creates a temporary directory. diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 38579168cfd..dbee593c544 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -11,6 +11,9 @@ import struct from test import support from io import BytesIO +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + try: import threading except ImportError: diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 09bafbdd933..30b5f167801 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -110,6 +110,7 @@ HAS_PYUP_PYDOWN = gdb_has_frame_select() BREAKPOINT_FN='builtin_id' +@support.skipIf(support.PGO, "not useful for PGO") class DebuggerTests(unittest.TestCase): """Test that the debugger can debug Python.""" diff --git a/Lib/test/test_multiprocessing_fork.py b/Lib/test/test_multiprocessing_fork.py index 2bf4e756449..9f22500e8fc 100644 --- a/Lib/test/test_multiprocessing_fork.py +++ b/Lib/test/test_multiprocessing_fork.py @@ -1,6 +1,12 @@ import unittest import test._test_multiprocessing +from test import support + +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + + test._test_multiprocessing.install_tests_in_module_dict(globals(), 'fork') if __name__ == '__main__': diff --git a/Lib/test/test_multiprocessing_forkserver.py b/Lib/test/test_multiprocessing_forkserver.py index 193a04a5fcb..407bb3f9b69 100644 --- a/Lib/test/test_multiprocessing_forkserver.py +++ b/Lib/test/test_multiprocessing_forkserver.py @@ -1,6 +1,11 @@ import unittest import test._test_multiprocessing +from test import support + +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + test._test_multiprocessing.install_tests_in_module_dict(globals(), 'forkserver') if __name__ == '__main__': diff --git a/Lib/test/test_multiprocessing_main_handling.py b/Lib/test/test_multiprocessing_main_handling.py index 2e15cd8a6bf..32593dab86d 100644 --- a/Lib/test/test_multiprocessing_main_handling.py +++ b/Lib/test/test_multiprocessing_main_handling.py @@ -16,6 +16,9 @@ from test.support.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, assert_python_ok) +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + # Look up which start methods are available to test import multiprocessing AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods()) diff --git a/Lib/test/test_multiprocessing_spawn.py b/Lib/test/test_multiprocessing_spawn.py index 334ae9e8f7a..6558952308f 100644 --- a/Lib/test/test_multiprocessing_spawn.py +++ b/Lib/test/test_multiprocessing_spawn.py @@ -1,6 +1,11 @@ import unittest import test._test_multiprocessing +from test import support + +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + test._test_multiprocessing.install_tests_in_module_dict(globals(), 'spawn') if __name__ == '__main__': diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 2bfb69cbfe0..09066063cb2 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -21,6 +21,9 @@ try: except ImportError: threading = None +if support.PGO: + raise unittest.SkipTest("test is not helpful for PGO") + mswindows = (sys.platform == "win32") # |