summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing sys import to socket_helper.py (GH-19791)Pablo Galindo2020-04-291-0/+1
|
* bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)Serhiy Storchaka2020-04-292-87/+90
|
* bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)Hai Shi2020-04-292-37/+39
| | | Add a new test.support.hashlib_helper submodule.
* bpo-40275: Avoid importing logging in test.support (GH-19601)Serhiy Storchaka2020-04-252-34/+29
| | | | | Import logging lazily in assertLogs() in unittest. Move TestHandler from test.support to logging_helper.
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-252-183/+182
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40275: Avoid importing asyncio in test.support (GH-19600)Serhiy Storchaka2020-04-251-1/+1
| | | | | * Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used). * Import asyncio.events lazily in test.support.
* bpo-39983: Add test.support.print_warning() (GH-19683)Victor Stinner2020-04-231-9/+12
| | | | | | | Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning().
* bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)Victor Stinner2020-04-231-0/+10
| | | | | | | | | | | * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser
* bpo-40241: Add pycore_gc.h header file (GH-19494)Victor Stinner2020-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the PyGC_Head structure and the following private macros to the internal C API: * _PyGCHead_FINALIZED() * _PyGCHead_NEXT() * _PyGCHead_PREV() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * _PyGCHead_SET_PREV() * _PyGC_FINALIZED() * _PyGC_PREV_MASK * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_SHIFT * _PyGC_SET_FINALIZED() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * _Py_AS_GC(o) Keep the private _PyGC_FINALIZED() macro in the public C API for backward compatibility with Python 3.8: make it an alias to the new PyObject_GC_IsFinalized() function. Move the SIZEOF_PYGC_HEAD constant from _testcapi module to _testinternalcapi module.
* bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)Victor Stinner2020-04-011-8/+1
| | | | | | | | | | | | | | Add os.waitstatus_to_exitcode() function to convert a wait status to an exitcode. Suggest waitstatus_to_exitcode() usage in the documentation when appropriate. Use waitstatus_to_exitcode() in: * multiprocessing, os, subprocess and _bootsubprocess modules; * test.support.wait_process(); * setup.py: run_command(); * and many tests.
* bpo-40094: Add missing import to wait_process() (GH-19268)Victor Stinner2020-04-011-0/+2
|
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-311-0/+59
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-031-3/+0
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* bpo-38991: Remove test.support.strip_python_stderr() (GH-17490)Victor Stinner2019-12-082-12/+1
| | | | | test.support: run_python_until_end(), assert_python_ok() and assert_python_failure() functions no longer strip whitespaces from stderr.
* bpo-37957: Allow regrtest to receive a file with test (and subtests) to ↵Pablo Galindo2019-11-191-12/+38
| | | | | | | ignore (GH-16989) When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored. For these reasons, add a new option to allow to ignore a list of test and subtests for these situations.
* bpo-38614: Add timeout constants to test.support (GH-16964)Victor Stinner2019-10-301-5/+56
| | | | | | | | Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
* bpo-38453: Resolve test directories before chdir to them (GH-16723)Steve Dower2019-10-141-1/+1
|
* bpo-38270: More fixes for strict crypto policy (GH-16418)Christian Heimes2019-09-271-4/+16
| | | | | | | | | | | | | | | test_hmac and test_hashlib test built-in hashing implementations and OpenSSL-based hashing implementations. Add more checks to skip OpenSSL implementations when a strict crypto policy is active. Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the EVP context. The EVP_DigestInit() function clears alls flags and breaks usedforsecurity flag again. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270
* bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382)Christian Heimes2019-09-251-0/+24
| | | | | | | | | | | Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270
* bpo-18578: Rename and document test.bytecode_helper as ↵Joannah Nanjekye2019-09-121-0/+41
| | | | | test.support.bytecode_helper (GH-15168) Rename and document test.bytecode_helper as test.support.bytecode_helper
* bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)Hai Shi2019-08-131-0/+3
| | | | | Add error number 113 EHOSTUNREACH to get_socket_conn_refused_errs() of test.support.
* bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)Serhiy Storchaka2019-08-081-0/+2
|
* bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)Serhiy Storchaka2019-08-041-1/+12
| | | | | The collection's item is now always at the left and the needle is on the right of ==.
* bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. ↵Serhiy Storchaka2019-08-041-0/+36
| | | | | | | | | (GH-14996) There was a discrepancy between the Python and C implementations. Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support to test mixed type comparison.
* bpo-37707: Exclude expensive unit tests from PGO task (GH-15009)Neil Schemenauer2019-07-301-0/+10
| | | | | Mark some individual tests to skip when --pgo is used. The tests marked increase the PGO task time significantly and likely don't help improve optimization of the final executable.
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-211-1/+1
|
* bpo-37552: Skip failing tests in strptime/strftime with UCRT version ↵Paul Monson2019-07-181-1/+23
| | | | | 17763.615 (#14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
* bpo-37526: Add support.catch_threading_exception() (GH-14664)Victor Stinner2019-07-091-0/+57
| | | | Context manager catching threading.Thread exception using threading.excepthook.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-2/+0
|
* bpo-37199: Fix test failures when IPv6 is unavailable or disabled (#14480)Zackery Spytz2019-06-301-0/+2
|
* bpo-37369: Fix initialization of sys members when launched via an app ↵Steve Dower2019-06-291-0/+79
| | | | | | | container (GH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
* bpo-36511: Add buildbot scripts and fix tests for Windows ARM32 buildbot ↵Paul Monson2019-06-191-1/+3
| | | | (GH-13454)
* bpo-37261: Document sys.unraisablehook corner cases (GH-14059)Victor Stinner2019-06-141-12/+3
| | | | | | | | | | | Document reference cycle and resurrected objects issues in sys.unraisablehook() and threading.excepthook() documentation. Fix test.support.catch_unraisable_exception(): __exit__() no longer ignores unraisable exceptions. Fix test_io test_writer_close_error_on_close(): use a second catch_unraisable_exception() to catch the BufferedWriter unraisable exception.
* bpo-37261: Fix support.catch_unraisable_exception() (GH-14052)Victor Stinner2019-06-131-2/+20
| | | | | The __exit__() method of test.support.catch_unraisable_exception context manager now ignores unraisable exception raised when clearing self.unraisable attribute.
* bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)Serhiy Storchaka2019-06-011-1/+1
|
* bpo-36829: Document test.support.catch_unraisable_exception() (GH-13554)Victor Stinner2019-05-241-3/+5
| | | | catch_unraisable_exception() now also removes its 'unraisable' attribute at the context manager exit.
* bpo-36829: Add test.support.catch_unraisable_exception() (GH-13490)Victor Stinner2019-05-221-0/+33
| | | | | | * Copy test_exceptions.test_unraisable() to test_sys.UnraisableHookTest(). * Use catch_unraisable_exception() in test_coroutines, test_exceptions, test_generators.
* bpo-36766: Typos in docs and code comments (GH-13116)penguindustin2019-05-061-1/+1
|
* bpo-36465: Make release and debug ABI compatible (GH-12615)Victor Stinner2019-04-241-1/+1
| | | | | | | | | | | | | | Release build and debug build are now ABI compatible: the Py_DEBUG define no longer implies Py_TRACE_REFS define which introduces the only ABI incompatibility. A new "./configure --with-trace-refs" build option is now required to get Py_TRACE_REFS define which adds sys.getobjects() function and PYTHONDUMPREFS environment variable. Changes: * Add ./configure --with-trace-refs * Py_DEBUG no longer implies Py_TRACE_REFS
* bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834)Victor Stinner2019-04-151-0/+16
| | | | Fix test_imap4_host_default_value() of test_imaplib: catch also errno.ENETUNREACH error.
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-052-35/+30
|
* bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)Stéphane Wirtel2019-02-221-0/+4
|
* bpo-35798: Add test.support.check_syntax_warning(). (#11895)Serhiy Storchaka2019-02-191-0/+29
| | | | | | | It checks that a SyntaxWarning is raised when compile specified statement, that it is raised only once, that it is converted to a SyntaxError when raised as exception, and that both warning and exception objects have corresponding attributes.
* Rework tuple hash tests. (GH-10161)Tim Peters2019-02-081-0/+41
| | | Add tooling that will useful in future updates, paying particular attention to difficult cases where only the upper bits on the input vary.
* bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)Dong-hee Na2019-01-171-2/+2
| | | Add a deprecated warning for the threading.Thread.isAlive() method.
* bpo-34897: avoid distutils test error when CXX is not set (GH-9706)Michael Felt2018-12-261-1/+1
| | | | | | Depending on system config, a missing candidate compiler name may be reported as the empty string rather than as None, so adjust the test helper accordingly.
* bpo-35519: Rename test.bisect to test.bisect_cmd (GH-11200)Victor Stinner2018-12-171-1/+1
| | | | | Rename test.bisect module to test.bisect_cmd to avoid conflict with bisect module when running directly a test like "./python Lib/test/test_xmlrpc.py".
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Victor Stinner2018-12-171-2/+2
| | | | | | | Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds).
* bpo-34279: regrtest consider that skipped tests are ran (GH-11132)Victor Stinner2018-12-141-1/+1
| | | | | | bpo-34279, bpo-35412: support.run_unittest() no longer raises TestDidNotRun if a test result contains skipped tests. The exception is now only raised if no test have been run and no test have been skipped.
* bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. ↵native-api2018-12-061-1/+5
| | | | (GH-7278)