summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
* [3.5] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2442)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)
* [3.5] bpo-30540, bpo-30523: Add --matchfile and --list-cases options to ↵Victor Stinner2017-06-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | regrtest (#2250) * bpo-30540: regrtest: add --matchfile option * 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_access() of the FileTests class of test_os: $ ./python -m test -v -m test.test_os.FileTests.test_access test_os * bpo-30523: regrtest: Add --list-cases option * Add --list-cases option to regrtest * Add get_abs_module() function, use it in list_cases() * Add ns mandatory positional argument to runtest() and runtest_inner() * Add file optional parameter to printlist() Co-Authored-By: Louie Lu <git@louie.lu>
* [3.5] bpo-30197: Enhance functions swap_attr() and swap_item() in ↵Serhiy Storchaka2017-04-281-4/+12
| | | | | | | | | | | test.support. (#1341) (#1346) 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)
* [3.5] bpo-30107: don't dump core on expected test_io crash (#1235) (#1344)Victor Stinner2017-04-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335) 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) * bpo-30107: don't dump core on expected test_io crash (#1235) test_io has two unit tests which trigger a deadlock: * test_daemon_threads_shutdown_stdout_deadlock() * test_daemon_threads_shutdown_stderr_deadlock() These tests call Py_FatalError() if the expected bug is triggered which calls abort(). Use test.support.SuppressCrashReport to prevent the creation on a core dump, to fix the warning: Warning -- files was modified by test_io Before: [] After: ['python.core']
* 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 #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-3/+10
| | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
* 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: 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 28668: Skip tests where instanciation of multiprocessing.QueueXavier de Gaye2016-11-151-0/+17
| | | | would raise ImportError
* 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.
* 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 #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+3
|
* Issue #18300: Set TERM='' by default in assert_python_*Berker Peksag2016-06-241-0/+4
|
* Issue #27289: Prevent test_urllib2net failures due to EOFError raised by ftplibBerker Peksag2016-06-121-1/+2
|
* Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+19
| | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* Issue #26325: Added test.support.check_no_resource_warning() to check thatSerhiy Storchaka2016-02-111-1/+23
| | | | no ResourceWarning is emitted.
* * Re-fix issue #19284: Don't generate the no-op -R command lineGregory P. Smith2015-12-141-1/+1
|\ | | | | | | | | | | | | | | parameter to "enable" the always on sys.flags.hash_randomization in _args_from_interpreter_flags() used by multiprocessing and some unittests. This simplifies the code. * assert_python_ok docstring typo fix. * Fix test_cmd_line not to fail if PYTHONHASHSEED is set to a fixed seed.
* | Issue #25626: Change zlib to accept Py_ssize_t and cap to UINT_MAXMartin Panter2015-11-201-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The underlying zlib library stores sizes in “unsigned int”. The corresponding Python parameters are all sizes of buffers filled in by zlib, so it is okay to reduce higher values to the UINT_MAX internal cap. OverflowError is still raised for sizes that do not fit in Py_ssize_t. Sizes are now limited to Py_ssize_t rather than unsigned long, because Python byte strings cannot be larger than Py_ssize_t. Previously this could result in a SystemError on 32-bit platforms. This resolves a regression in the gzip module when reading more than UINT_MAX or LONG_MAX bytes in one call, introduced by revision 62723172412c.
* | Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-021-1/+1
|\ \ | |/
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | Fix remaining tests and remove an unused import.Berker Peksag2015-05-061-1/+1
| |
* | Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-0/+244
| | | | | | | | Patch by Christie Wilson.
* | issue9859: Document test.support.detect_api_mismatch() and simplify its test.Gregory P. Smith2015-04-141-1/+1
| |
* | issue9859: Adds a test.support.detect_api_mismatch function useful toGregory P. Smith2015-04-141-1/+16
| | | | | | | | compare the public APIs of two modules or classes.
* | Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-12/+8
| | | | | | | | | | | | The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
* | Skip nntplib tests when transient errors captured.Berker Peksag2015-04-081-0/+5
|\ \ | |/
| * Skip nntplib tests when transient errors captured.Berker Peksag2015-04-081-0/+5
| |
* | Escaped backslashes in docstrings.Serhiy Storchaka2015-04-031-3/+3
|\ \ | |/
| * Escaped backslashes in docstrings.Serhiy Storchaka2015-04-031-3/+3
| |
* | Issue #23799: Added test.support.start_threads() for running and cleaning upSerhiy Storchaka2015-04-011-1/+38
|\ \ | |/ | | | | multiple threads.
| * Issue #23799: Added test.support.start_threads() for running and cleaning upSerhiy Storchaka2015-04-011-1/+38
| | | | | | | | multiple threads.
* | Merge 3.4 (test.support)Victor Stinner2015-03-271-1/+1
|\ \ | |/
| * Issue #23445: Fix test.support.python_is_optimized() for CFLAGS=-OgVictor Stinner2015-03-271-1/+1
| | | | | | | | -Og does not optimize the C code, it's just "fast debugging".
* | Issue #22289: merge from 3.4Ned Deily2015-03-221-1/+2
|\ \ | |/
| * Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout.Ned Deily2015-03-221-1/+2
| |
* | Issue #20876: correctly close temporary file in ↵Antoine Pitrou2015-03-071-10/+9
|\ \ | |/ | | | | test.support.fs_is_case_insensitive()
| * Issue #20876: correctly close temporary file in ↵Antoine Pitrou2015-03-071-10/+9
| | | | | | | | test.support.fs_is_case_insensitive()
* | Issue #23387: Skip test_issue16464 if it raises an 5xx error.Berker Peksag2015-03-021-0/+2
|\ \ | |/ | | | | | | Also, remove support.run_doctest() since there is no doctests in test_urllib2 and urllib.request.
| * Issue #23387: Skip test_issue16464 if it raises an 5xx error.Berker Peksag2015-03-021-0/+2
| | | | | | | | | | Also, remove support.run_doctest() since there is no doctests in test_urllib2 and urllib.request.
* | Issue 23314: SuppressCrashReports now disables CRT assertionsSteve Dower2015-02-231-0/+27
| | | | | | | | SuppressCrashReports should be used in test subprocesses that test invalid conditions.
* | Issue #17554: Print "fetching <url> ..." messages only in verbose mode.Berker Peksag2014-12-101-1/+2
|/ | | | Patch by Ezio Melotti.
* handle errors without a reason attributeBenjamin Peterson2014-11-251-1/+1
|
* don't fail tests when www.python.org can't be validated by the systemBenjamin Peterson2014-11-251-0/+12
|
* Try to transfer the Unicode test data files gzipped.Georg Brandl2014-11-061-1/+6
|
* Issue #22770: Prevent some Tk segfaults on OS X when running gui tests.Ned Deily2014-11-021-3/+2
| | | | | | | When running tests in subprocesses with the regrtest -j option, a bug in Cocoa Tk can result in a Tcl segfault. Avoid the problem by forcing Tk to fully initialize as an OS X gui process before destroying the Tcl instance and creating another. (Original patch by Serhiy Storchaka)
* Issue #22596: support.transient_internet() now also catchesBerker Peksag2014-10-251-0/+3
| | | | | | ConnectionRefusedError exceptions wrapped by urllib.error.URLError. This change should fix sporadic failures in test_urllib2net.
* Issue #22002: Make full use of test discovery in test sub-packages.Zachary Ware2014-07-231-1/+20
| | | | | | Adds `load_package_tests` function to test.support, uses it in test_asyncio, test_email, test_json, test_tools, test_importlib and all test_importlib sub-packages to implement test discovery.
* Issue #19629: Add missing "import stat"Victor Stinner2014-07-211-12/+13
| | | | Sort also imports in support/__init__.py