summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31324: Optimize support._match_test() (#4421)Victor Stinner2017-11-211-12/+55
| | | | | | | | | | | * Rename support._match_test() to support.match_test(): make it public * Remove support.match_tests global variable. It is replaced with a new support.set_match_tests() function, so match_test() doesn't have to check each time if patterns were modified. * Rewrite match_test(): use different code paths depending on the kind of patterns for best performances. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)xdegaye2017-11-121-2/+1
| | | | | | Access to mkfifo(), mknod() and hard link creation is controled by SELinux on Android. Also remove test.support.android_not_root.
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-31629: Add support.SaveSignals (#4183)Victor Stinner2017-10-311-0/+39
| | | | | test_curses now saves/restores signals. On FreeBSD, the curses module sets handlers of some signals, but don't restore old handlers when the module is deinitialized.
* Trivial cleanups following bpo-31370 (#3649)Antoine Pitrou2017-09-181-1/+0
| | | | | | * Trivial cleanups following bpo-31370 * Also cleanup the "importlib._bootstrap_external" module
* bpo-31234: Add support.join_thread() helper (#3587)Victor Stinner2017-09-141-0/+10
| | | | join_thread() joins a thread but raises an AssertionError if the thread is still alive after timeout seconds.
* bpo-31234: Add test.support.wait_threads_exit() (#3578)Victor Stinner2017-09-141-0/+35
| | | | Use _thread.count() to wait until threads exit. The new context manager prevents the "dangling thread" warning.
* bpo-31234: threading_cleanup() now warns immediately (#3138)Victor Stinner2017-09-131-9/+19
| | | | | | support.threading_cleanup() waits for 1 second before emitting a warning if there are threads running in the background. With this change, it now emits the warning immediately, to be able to catch bugs more easily.
* bpo-29639: change test.support.HOST to "localhost"Gregory P. Smith2017-09-091-3/+2
| | | | | | | | | | test.support.HOST should be "localhost" as it was in the past. See the bpo-29639. Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant. This changes the definition and fixes tests that needed updating to deal with HOST being the hostname rather than the hardcoded IP address. This is only the first step in addressing https://bugs.python.org/issue29639.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-14/+3
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Enhance support.reap_children() (#3036)Victor Stinner2017-08-101-12/+21
| | | | | | | * reap_children() now sets environment_altered to True to detect bugs using python3 -m test --fail-env-changed * Replace bare "except:" with "except OSError:" in reap_children() * Write an unit test for reap_children() using a timeout of 60 seconds
* bpo-31009: Fix support.fd_count() on Windows (#2862)Victor Stinner2017-07-251-16/+42
| | | | | | | | | | * bpo-31009: Fix support.fd_count() on Windows On Windows, test.support.fd_count() now calls msvcrt.CrtSetReportMode() to not kill the process nor log any error on stderr on os.dup(fd) if the file descriptor is invalid. * Fix for release mode
* bpo-26732: fix too many fds in processes started with the "forkserver" ↵Antoine Pitrou2017-07-221-1/+32
| | | | | | | | | | method (#2813) * bpo-26732: fix too many fds in processes started with the "forkserver" method A child process would inherit as many fds as the number of still-running children. * Add blurb and test comment
* bpo-30845: Enhance test_concurrent_futures cleanup (#2564)Victor Stinner2017-07-041-1/+2
| | | | | | | | | | | * bpo-30845: reap_children() now logs warnings * bpo-30845: Enhance test_concurrent_futures cleanup In setUp() and tearDown() methods of test_concurrent_futures tests, make sure that tests don't leak threads nor processes. Clear explicitly the reference to the executor to make it that it's destroyed (to prevent "dangling threads" warning).
* threading_cleanup() failure marks test as ENV_CHANGED (#2500)Victor Stinner2017-06-301-0/+12
| | | | | | | If threading_cleanup() fails to cleanup threads, set a a new support.environment_altered flag to true, flag uses by save_env which is used by regrtest to check if a test altered the environment. At the end, the test file fails with ENV_CHANGED instead of SUCCESS, to report that it altered the environment.
* bpo-30523: regrtest --list-cases --match (#2401)Victor Stinner2017-06-261-14/+18
| | | | | | | * 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.
* bpo-28180: Implementation for PEP 538 (#659)Nick Coghlan2017-06-111-26/+30
| | | | | | | | | | - new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time
* bpo-30540: regrtest: add --matchfile option (#1909)Victor Stinner2017-06-091-2/+8
| | | | | | | | | | | | | | | * Add a new option taking a filename to get a list of test names to filter tests. * support.match_tests becomes a list. * Modify run_unittest() to accept to match the whole test identifier, not just a part of a test identifier. For example, the following command only runs test_default_timeout() of the BarrierTests class of test_threading: $ ./python -m test -v test_threading -m test.test_threading.BarrierTests.test_default_timeout Remove also some empty lines from test_regrtest.py to make flake8 tool happy.
* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. ↵Serhiy Storchaka2017-04-281-4/+12
| | | | | | | | | | | | | (#1341) * bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. They now work when delete replaced attribute or item inside the with statement. The old value of the attribute or item (or None if it doesn't exist) now will be assigned to the target of the "as" clause, if there is one. * Update docstrings.
* bpo-30107: Make SuppressCrashReport quiet on macOS (#1279)Victor Stinner2017-04-251-4/+9
| | | | | | | | | On macOS, SuppressCrashReport now redirects /usr/bin/defaults command stderr into a pipe to not pollute stderr. It fixes a test_io.test_daemon_threads_shutdown_stderr_deadlock() failure when the CrashReporter domain doesn't exists. Message logged into stderr: 2017-04-24 16:57:21.432 defaults[41046:2462851] The domain/default pair of (com.apple.CrashReporter, DialogType) does not exist
* bpo-30125: disable faulthandler in ctypes test_SEH (#1237)Victor Stinner2017-04-211-0/+16
| | | | | | | | Disable faulthandler to run test_SEH() of test_ctypes to prevent the following log with a traceback: Windows fatal exception: access violation Add support.disable_faulthandler() context manager.
* support.threading_cleanup() log a warning on fail (#1195)Victor Stinner2017-04-201-1/+8
| | | | | | | | | | | | The @reap_threads decorator and the threading_cleanup() function of test.support now log a warning if they fail to clenaup threads. Fix also the usage of support.threading_cleanup() in test_urllib2_localnet. The log may help to debug such other warning seen on the AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot: Warning -- threading._dangling was modified by test_logging
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-1/+1
|
* support: temp_dir() and change_cwd() uses repr() in error messageVictor Stinner2017-02-081-2/+2
| | | | | Serhiy Storshaka pointed me that str(path) can emit a BytesWarning: use repr(path) instead.
* Update test_support for my temp_dir/change_cwd changesVictor Stinner2017-02-081-1/+1
|
* support: add more info on temp_dir() and change_cwd() failureVictor Stinner2017-02-081-4/+6
| | | | Log the OSError exception message.
* Merge 3.6Victor Stinner2017-01-121-7/+18
|\
| * Merge 3.5Victor Stinner2017-01-121-7/+18
| |\
| | * Fix script_helper.run_python_until_end(): copy SYSTEMROOTVictor Stinner2017-01-121-7/+18
| | | | | | | | | | | | | | | | | | Windows requires at least the SYSTEMROOT environment variable to start Python. If run_python_until_end() doesn't copy SYSTEMROOT, the function always fail on Windows.
* | | Remove unused imports.Serhiy Storchaka2016-12-161-3/+0
| | |
* | | Issue #28683: Merge 3.6.Xavier de Gaye2016-12-141-0/+10
|\ \ \ | |/ /
| * | Issue #28683: Fix the tests that bind() a unix socket and raise PermissionErrorXavier de Gaye2016-12-141-0/+10
| | | | | | | | | | | | on Android for a non-root user.
* | | Issue #28759: Merge 3.6.Xavier de Gaye2016-12-131-1/+2
|\ \ \ | |/ /
| * | Issue #28759: Fix the tests that fail with PermissionError when run asXavier de Gaye2016-12-131-1/+2
| | | | | | | | | | | | a non-root user on Android where access rights are controled by SELinux MAC.
* | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-3/+10
|\ \ \ | |/ / | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
| * | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-3/+10
| |\ \ | | |/ | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
| | * Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-3/+10
| | | | | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
* | | Issue #26939: Merge 3.6.Xavier de Gaye2016-12-081-0/+16
|\ \ \ | |/ /
| * | Issue #26939: Add the support.setswitchinterval() function to fixXavier de Gaye2016-12-081-0/+16
| | | | | | | | | | | | test_functools hanging on the Android armv7 qemu emulator.
* | | Issue #28847: dbm.dumb now supports reading read-only files and no longerSerhiy Storchaka2016-12-071-2/+2
|\ \ \ | |/ / | | | | | | writes the index file when it is not changed.
| * | Issue #28847: dbm.dumb now supports reading read-only files and no longerSerhiy Storchaka2016-12-071-2/+2
| |\ \ | | |/ | | | | | | writes the index file when it is not changed.
| | * Issue #28847: dbm.dumb now supports reading read-only files and no longerSerhiy Storchaka2016-12-071-3/+3
| | | | | | | | | | | | writes the index file when it is not changed.
| * | Issue #28666: Fix removing readonly directories on Windows.Serhiy Storchaka2016-11-201-1/+1
| |\ \ | | |/
| | * Issue #28666: Fix removing readonly directories on Windows.Serhiy Storchaka2016-11-201-1/+1
| | |
* | | Add sys.getandroidapilevel()Victor Stinner2016-12-021-2/+7
| | | | | | | | | | | | | | | | | | | | | Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
* | | Issue #28666: Try to fix removing readonly directories on Windows.Serhiy Storchaka2016-11-201-1/+1
|/ /
* | Issue #28666: Now test.support.rmtree is able to remove unwritable orSerhiy Storchaka2016-11-201-15/+16
|\ \ | |/ | | | | unreadable directories on Windows too.
| * Issue #28666: Now test.support.rmtree is able to remove unwritable orSerhiy Storchaka2016-11-201-15/+16
| | | | | | | | unreadable directories on Windows too.
* | Issue #28666: Now test.support.rmtree is able to remove unwritable orSerhiy Storchaka2016-11-201-1/+31
|\ \ | |/ | | | | unreadable directories.
| * Issue #28666: Now test.support.rmtree is able to remove unwritable orSerhiy Storchaka2016-11-201-1/+31
| | | | | | | | unreadable directories.