summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30448: Fix support.SuppressCrashReport on macOS (#2515)Victor Stinner2017-06-301-2/+2
| | | Add missing "import subprocess".
* [2.7] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2444)Victor Stinner2017-06-271-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-30523: regrtest --list-cases --match (#2401) * regrtest --list-cases now supports --match and --match-file options. Example: ./python -m test --list-cases -m FileTests test_os * --list-cases now also sets support.verbose to False to prevent messages to stdout when loading test modules. * Add support._match_test() private function. (cherry picked from commit ace56d583664f855d89d1219ece7c21c2fddcf30) (cherry picked from commit 36946c06a3bdb1104c53f0fe535086572ffbdd9e) * bpo-30764: regrtest: add --fail-env-changed option (#2402) * bpo-30764: regrtest: change exit code on failure * Exit code 2 if failed tests ("bad") * Exit code 3 if interrupted * bpo-30764: regrtest: add --fail-env-changed option If the option is set, mark a test as failed if it alters the environment, for example if it creates a file without removing it. (cherry picked from commit 63f54c68936d648c70ca411661e4208329edcf26) (cherry picked from commit 1f33857a3677de84bdc6d80c39f577eb081ed85d) * bpo-30776: reduce regrtest -R false positives (#2422) * Change the regrtest --huntrleaks checker to decide if a test file leaks or not. Require that each run leaks at least 1 reference. * Warmup runs are now completely ignored: ignored in the checker test and not used anymore to compute the sum. * Add an unit test for a reference leak. Example of reference differences previously considered a failure (leak) and now considered as success (success, no leak): [3, 0, 0] [0, 1, 0] [8, -8, 1] (cherry picked from commit 48b5c422ffb03affb00c184b9a99e5537be92732) (cherry picked from commit e0f8b43a46850aa5e5992465cab684496f102fe5)
* bpo-30705: Fix test_regrtest.test_crashed() (#2439)Victor Stinner2017-06-271-0/+14
| | | | | | | * Add test.support._crash_python() which triggers a crash but uses test.support.SuppressCrashReport() to prevent a crash report from popping up. * Modify test_child_terminated_in_stopped_state() of test_subprocess and test_crashed() of test_regrtest to use _crash_python().
* bpo-30764: Windows support.SuppressCrashReport (#2423)Victor Stinner2017-06-271-13/+39
| | | | | | * Add Windows support to test.support.SuppressCrashReport: call SetErrorMode() and CrtSetReportMode(). * _testcapi: add CrtSetReportMode() and CrtSetReportFile() functions and CRT_xxx and CRTDBG_xxx constants needed by SuppressCrashReport.
* [2.7] bpo-30764: test_subprocess uses SuppressCrashReport (#2405) (#2412)Victor Stinner2017-06-261-1/+78
| | | | | | | | | | | | | | | * bpo-30764: Backport support.SuppressCrashReport Backport test.support.SuppressCrashReport context-manager from master. Drop the Windows implementation since it depends on msvcrt.CrtSetReportMode() which isn't available on Python 2.7. * bpo-30764: test_subprocess uses SuppressCrashReport (#2405) bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of test_subprocess now uses support.SuppressCrashReport() to prevent the creation of a core dump on FreeBSD. (cherry picked from commit cdee3f14f7f4c995e7eedb0bf6a67e260c739f7d)
* bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest ↵Victor Stinner2017-06-161-2/+8
| | | | | (#2249) [2.7] bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest
* [2.7] bpo-30366: Backport tests for test.support. (#1582)Serhiy Storchaka2017-05-151-35/+86
| | | | | | | Also backport new functions temp_dir() and python_is_optimized(). temp_cwd() now accepts None as a name (means using tempfile.mkdtemp). check_syntax_error() now accepts arguments lineno and offset. Use more specific error messages in get_attribute().
* bpo-30265: support.unlink() don't catch any OSError (#1456)Victor Stinner2017-05-051-2/+3
| | | | support.unlink() now only ignores ENOENT and ENOTDIR, instead of ignoring any OSError exception.
* [2.7] bpo-30236: Backported regrtest options -m and -G. (#1394)Serhiy Storchaka2017-05-031-1/+24
|
* bpo-30207: Rename test.test_support to test.support. (#1353)Serhiy Storchaka2017-04-302-0/+1933
To simplify backports from Python 3, the test.test_support module was converted into a package and renamed to test.support. The test.script_helper module was moved into the test.support package. Names test.test_support and test.script_helper are left as aliases to test.support and test.support.script_helper.