Commit Graph

531 Commits

Author SHA1 Message Date
Victor Stinner 7aa8fcc8eb
gh-109162: libregrtest: use relative imports (#109250)
libregrtest.__init__ no longer exposes any symbol, so
"python -m test.libregrtest.worker" imports less modules.
2023-09-11 07:02:35 +00:00
Victor Stinner 8b7db5a111
bpo-37473: Don't import importlib ASAP in tests (GH-14661)
bpo-15386, bpo-37473: test_import, regrtest and libregrtest no longer
import importlib as soon as possible, as the first import, "to test
bpo-15386".

It is tested by test_import.test_there_can_be_only_one().

Sort test_import imports.
2019-07-14 19:31:12 +02:00
Xiang Zhang 772bf2ed83 Issue #28950: Disallow -j0 combined with -T/-l in regrtest. 2016-12-19 22:00:22 +08:00
Xiang Zhang 270a21fda0 Issue #28950: Disallow -j0 combined with -T/-l/-M in regrtest. 2016-12-19 21:01:33 +08:00
Victor Stinner 6c7fb55d44 Issue #28688: Remove warnings.filters check from regrtest
Reloading the warnings module duplicates filters in warnings.filters. Fixing
the issue is tricky. It was decided to simply remove the check from Python 3.5,
since the bug only impacts Python unit tests, not real applications.

The check is kept in Python 3.6 and newer.
2016-11-21 16:44:01 +01:00
Serhiy Storchaka daeddc48a4 Issue #23839: Various caches now are cleared before running every test file. 2016-11-11 11:42:47 +02:00
Serhiy Storchaka 28f42fd4f8 Issue #28649: Clear the typing module caches when search for reference leaks. 2016-11-09 23:49:02 +02:00
Victor Stinner 1f6b69b749 Issue #28409: regrtest: fix the parser of command line arguments. 2016-10-17 18:11:03 +02:00
Victor Stinner bd2ffa5022 Issue #27829: regrtest -W displays stderr if env changed
regrtest -W hides output if a test pass, but also when env changed and so the
env changed warning is hidden. So it's hard to debug. With this change, stderr
is now always displayed when a test doesn't pass.
2016-09-23 11:13:53 +02:00
Victor Stinner c7a070e998 regrtest: accept options after test names 2016-09-10 04:27:28 -04:00
Martin Panter 68c1f1ed03 Issue #27787: Clean up weak references before checking for dangling threads 2016-08-20 06:50:14 +00:00
Victor Stinner 8ba2083e0e Issue #26643: Add missing shutil resources to regrtest.py 2016-03-29 13:33:35 +02:00
Victor Stinner 3aac0adfe0 Cleanup regrtest "main()" function
* Rename libregrtest.main_in_temp_cwd() to libregrtest.main()
* Add regrtest.main_in_temp_cwd() alias to libregrtest.main()
* Move old main_in_temp_cwd() code into libregrtest.Regrtest.main()
* Update multiple scripts to call libregrtest.main()
2016-03-24 17:53:20 +01:00
Victor Stinner 4ffcc3ee1e Cleanup regrtest.py
* Move code into a new _main() function
* Fix loop to cleanup sys.path
* Remove unused import
2016-03-24 17:43:53 +01:00
Serhiy Storchaka fc632e3912 Merge with 3.5. 2015-10-06 18:52:52 +03:00
Brett Cannon be7c1638e2 Issue #25188: Add a -P/--pgo flag to regrtest to silence error output.
Since PGO building doesn't care about test failures, silence them when
running the test suite for performance reasons. Initial patch by
Alecsandru Patrascu of Intel.
2015-10-02 16:16:44 -07:00
Victor Stinner 36b3fbb0ee Issue #25220: Fix Lib/test/autotest.py 2015-09-27 11:19:08 +02:00
Victor Stinner 3844fe5ed8 Issue #25220: Move most regrtest.py code to libregrtest 2015-09-26 10:38:01 +02:00
Victor Stinner 98de5340d4 Issue #25220: Create Lib/test/libregrtest/
Start to split regrtest.py into smaller parts with the creation of
Lib/test/libregrtest/cmdline.py: code to handle the command line, especially
parsing command line arguments. This part of the code is tested by
test_regrtest.
2015-09-26 09:43:45 +02:00
Victor Stinner 0cca00b67e Issue #25220: Backed out changeset eaf9a99b6bb8 2015-09-23 23:16:47 +02:00
Victor Stinner 7b92abf0e9 Issue #25220: Create Lib/test/libregrtest/
Start to split regrtest.py into smaller parts with the creation of
Lib/test/libregrtest/cmdline.py.
2015-09-23 23:04:18 +02:00
Zachary Ware 83ee5a315f Merge 3.4 2015-08-08 22:03:43 -05:00
Zachary Ware 9a47ed8839 regrtest: the 'bad' and 'environment_changed' sets of tests don't intersect anymore 2015-08-08 22:03:27 -05:00
Zachary Ware 920a335e97 Issue #24751: When running regrtest with '-w', don't fail if re-run succeeds. 2015-08-04 21:54:54 -05:00
Zachary Ware 40648838b2 Issue #24751: Merge with 3.4 2015-08-04 21:58:00 -05:00
Serhiy Storchaka e98209c2b4 Issue #24245: Eliminated senseless expect clauses that have no any effect.
Patch by Martin Panter.
2015-05-20 16:10:04 +03:00
Serhiy Storchaka 10915aa85c Issue #22390: test.regrtest now emits a warning if temporary files or
directories are left after running a test.
2015-03-30 01:30:22 +03:00
Serhiy Storchaka a3a100b594 Issue #22390: test.regrtest now emits a warning if temporary files or
directories are left after running a test.
2015-03-30 01:28:02 +03:00
Victor Stinner 5d575399bc Issue #23145: regrtest now shows errors and raises an exception if
loader.loadTestsFromModule() logged errors.
2015-01-06 14:05:03 +01:00
Zachary Ware 69fb6a41c5 Issue #22104: Don't hold a reference to the loaded TestSuite in runtest_inner 2014-08-04 11:15:10 -05:00
Benjamin Peterson f617fa88de merge 3.3 2014-02-16 14:53:55 -05:00
Benjamin Peterson cf62603276 backout fafac90b69c4 2014-02-16 14:52:01 -05:00
Benjamin Peterson a118c4fa79 merge 3.3 2014-01-09 11:12:31 -06:00
Benjamin Peterson 50b82c765f clear zip stat cache after each ref leak run 2014-01-09 11:10:30 -06:00
Christian Heimes 985ecdcfc2 ssue #19183: Implement PEP 456 'secure and interchangeable hash algorithm'.
Python now uses SipHash24 on all major platforms.
2013-11-20 11:46:18 +01:00
Eli Bendersky e8de29669d Remove unused --debug option of regrtest.
If bots fail due to using this flag, the buildbot scripts have to be modified
to omit it. Regrtest ignores it anyway.
2013-09-02 17:01:10 -07:00
Eli Bendersky e5eebedd55 Fix docstring and some indentation 2013-09-02 16:52:25 -07:00
Eli Bendersky 7f5c22c022 Refactor the main function of regrtest a bit.
Moving subprocess execution of tests into a function.
2013-09-02 08:57:21 -07:00
Andrew Svetlov 8913a6c83d Issue #11798: fix tests for regrtest -R : 2013-09-01 07:58:41 +03:00
Richard Oudkerk 83d7dea6aa Issue #8713: Cleanup before saving process._dangling. 2013-08-29 12:51:11 +01:00
Serhiy Storchaka 64f7c4e4ca Issue #16799: Switched from getopt to argparse style in regrtest's argument
parsing.  Added more tests for regrtest's argument parsing.
2013-08-29 12:26:23 +03:00
Richard Oudkerk 84ed9a68bd Issue #8713: Support alternative start methods in multiprocessing on Unix.
See http://hg.python.org/sandbox/sbt#spawn
2013-08-14 15:35:41 +01:00
Florent Xicluna 8624ed502f Issue #18375: merge with 3.3 2013-07-06 12:27:50 +02:00
Florent Xicluna d9e7c86d7e Issue #18375: Assume --randomize when --randseed is used for running the testsuite. 2013-07-06 12:25:52 +02:00
Brett Cannon 260fbe80c5 Issue #15767: Excise the remaining instances of ModuleNotFoundError 2013-07-04 18:16:15 -04:00
Charles-François Natali 37cfb0a920 Issue #17914: Use os.cpu_count() instead of multiprocessing.cpu_count() where
applicable.
2013-06-28 19:25:45 +02:00
Victor Stinner 383a820e0d Issue #17206: test.regrtest and test.script_helper enable faulthandler module
in subprocesses.
2013-06-25 21:24:36 +02:00
Victor Stinner 546ccf090e Issue #18228: Use locale.setlocale(name, None) instead of
locale.getlocale(name) in test.regrtest.saved_test_environment

locale.getlocale() parses the locale, which is useless for
saved_test_environment.
2013-06-17 21:28:14 +02:00
Victor Stinner d9ccf7fe22 Issue #18228: Fix locale test of test.regrtest.saved_test_environment
Skip LC_ALL becore getlocale(locale.LC_ALL) always fail, and catch also
ValueError.
2013-06-17 20:40:05 +02:00
Victor Stinner a222de1a23 (Merge 3.3) regrtest.py: Fix another typo in the usage of the faulthandler module 2013-06-17 20:35:42 +02:00