summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)Miss Islington (bot)2018-06-061-8/+10
| | | | | | | | | | | | Substract one because listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. Add test_support.test_fd_count(). Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure that the report mode is always restored on failure. (cherry picked from commit 492d6424a7ca907c8ec1df21e51062e8f3d88e32) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33718: Update regrtest from master (GH-7325)Victor Stinner2018-06-011-0/+8
| | | | * Add support.environment_altered: unused yet * VSTS: don't run tests with --fail-env-changed
* [3.6] bpo-31234: Add test.support.wait_threads_exit() (GH-3578) (GH-7315)Victor Stinner2018-06-011-0/+36
| | | | | | | | | | | | | | | | | | | * bpo-31234: Add test.support.wait_threads_exit() (GH-3578) Use _thread.count() to wait until threads exit. The new context manager prevents the "dangling thread" warning. (cherry picked from commit ff40ecda73178dfcad24e26240d684356ef20793) * bpo-31234: Try to fix lock_tests warning (#3557) Try to fix the "Warning -- threading_cleanup() failed to cleanup 1 threads" warning in test.lock_tests: wait a little bit longer to give time to the threads to complete. Warning seen on test_thread and test_importlib. (cherry picked from commit 096ae3373abac2c8b3a26a3fe33cc8bd4cbccd4e)
* bpo-31009: Move fd_count() to test.support (#7308)Victor Stinner2018-06-011-1/+58
| | | | | | * Move fd_count() from test.libregrtest.refleak to test.support * Fix support.fd_count() on Windows: Call CrtSetReportMode() to not kill the process on invalid file descriptor if Python is compiled in debug mode.
* bpo-33522: Enable CI builds on Visual Studio Team Services (GH-6865) (GH-6925)Steve Dower2018-05-171-1/+21
|
* Fix spelling typo (GH-6443) (#6508)Miss Islington (bot)2018-04-171-1/+1
| | | | | (cherry picked from commit 28e8b66d6c632552765b5fb4573b7f3c9decc3c1) Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
* [3.6] bpo-32964: Reuse a testing implementation of the path protocol in ↵Serhiy Storchaka2018-03-031-0/+18
| | | | | | | tests. (GH-5930). (GH-5958) (cherry picked from commit b21d155f57d284aecf9092a9bd24258293965c2f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066) (GH-5826)Anselm Kruis2018-02-231-1/+5
| | | | | | | Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from. If a forked child exits the context manager it won't do the cleanup.. (cherry picked from commit 33dddac00ba8d9b72cf21b8698504077eb3c23ad) Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
* [3.6] Improves the ability to build in CI (GH-5730)Steve Dower2018-02-181-1/+8
|
* [3.6] bpo-31324: Optimize support._match_test() (#4523)Victor Stinner2017-11-231-12/+57
| | | | | | | | | | | | | | | | | | | * bpo-31324: Optimize support._match_test() (#4421) * 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> (cherry picked from commit 803ddd8ce22f0de3ab42fb98a225a704c000ef06) * bpo-31324: Fix test.support.set_match_tests(None) (#4505) (cherry picked from commit bb11c3c967afaf263e00844d4ab461b7fafd6d36)
* [3.6] bpo-28759: Skip some tests on PermissionError raised by Android ↵xdegaye2017-11-121-2/+1
| | | | | | (GH-4350) (#4380) (cherry picked from commit 92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb)
* bpo-31629: Add support.SaveSignals (#4183) (#4187)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. (cherry picked from commit 19f68301a1295a9c30d9f28b8f1479cdcccd75aa)
* bpo-30845: Enhance test_concurrent_futures cleanup (#2564) (#2880)Victor Stinner2017-07-261-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). (cherry picked from commit 3df9dec425b0254df1cdf41922fd8d6b08bf47e4)
* [3.6] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2441)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) * 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) * 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)
* Synchronize libregrtest from master to 3.6 (#2244)Victor Stinner2017-06-161-2/+8
| | | | | | | * bpo-30523: regrtest: Add --list-cases option (#2238) * bpo-30284: Fix regrtest for out of tree build (#1481) * bpo-30540: regrtest: add --matchfile option (#1909) * bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479) * bpo-30263: regrtest: log system load (#1452)
* [3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in ↵Serhiy Storchaka2017-04-281-4/+12
| | | | | | | | | | | test.support. (GH-1341) (#1345) 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. (cherry picked from commit d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83)
* bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343)Victor Stinner2017-04-281-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. (cherry picked from commit a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d)
* bpo-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335)Victor Stinner2017-04-281-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 (cherry picked from commit d819ad9832292d854e9710493ecdf959b69802e3)
* 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.
* | 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: 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 #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-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
| |
* | 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.
* | Issue 26931: Skip the test_distutils tests using a compiler executableXavier de Gaye2016-11-171-1/+26
| | | | | | | | that is not found
* | Issue 28668: Merge 3.5Xavier de Gaye2016-11-151-1/+17
|\ \ | |/
| * Issue 28668: Skip tests where instanciation of multiprocessing.QueueXavier de Gaye2016-11-151-0/+17
| | | | | | | | would raise ImportError
* | Issue #26934: Handle _ANDROID_API_LEVEL is None on WindowsXavier de Gaye2016-11-131-1/+1
| |
* | Fix test_faulthandler on Android where raise() exits with 0Xavier de Gaye2016-11-131-2/+10
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-1/+1
| | | | | | | | | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* | Adds test.support.PGO and skips tests that are not useful for PGO.Steve Dower2016-09-071-1/+5
| |
* | Issue #27355: Removed support for Windows CE. It was never finished,Larry Hastings2016-09-051-1/+1
| | | | | | | | and Windows CE is no longer a relevant platform for Python.
* | Merge with 3.5Terry Jan Reedy2016-09-051-2/+3
|\ \ | |/
| * Issue #27918# test.resource.is_gui_available no longer flashes tk window.Terry Jan Reedy2016-09-051-2/+3
| | | | | | | | Also, don't run it if 'gui' is not requested. Patch by Xiang Zhang.
* | Merge 3.5 (script_helper)Victor Stinner2016-08-171-8/+8
|\ \ | |/
| * script_helper: kill the subprocess on errorVictor Stinner2016-08-171-8/+8
| | | | | | | | | | | | | | | | If Popen.communicate() raises an exception, kill the child process to not leave a running child process in background and maybe create a zombi process. This change fixes a ResourceWarning in Python 3.6 when unit tests are interrupted by CTRL+c.
* | Issue #27472: Add test.support.unix_shell as the path to the default shell.Xavier de Gaye2016-07-221-1/+6
| |
* | Issue #27027: Added test.support.is_android that is True when this is anXavier de Gaye2016-07-101-1/+3
| | | | | | | | Android build.
* | Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+3
|\ \ | |/
| * Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+3
| |
* | Issue #18300: Merge from 3.5Berker Peksag2016-06-241-0/+4
|\ \ | |/