summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-073-1704/+0
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)Victor Stinner2021-12-021-1/+1
| | | | | | | Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and invert the value. Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in PyConfig.code_debug_ranges documentation.
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-153-0/+1704
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-45668: Fix PGO tests without test extensions (GH-29315)Christian Heimes2021-11-011-2/+8
|
* bpo-45629: Add a test for the "freeze" tool. (gh-29222)Eric Snow2021-10-281-0/+11
| | | | | | | The "freeze" tool has been part of the repo for a long time. However, it hasn't had any tests in the test suite to guard against regressions. We add such a test here. This is especially important as there has been a lot of change recently related to frozen modules, with more to come. Note that as part of the test we build Python out-of-tree and install it in a temp dir. https://bugs.python.org/issue45629
* bpo-45410: regrtest -W leaves stdout/err FD unchanged (GH-28915)Victor Stinner2021-10-131-3/+5
| | | | | | | | | | | | support.print_warning() now stores the original value of sys.__stderr__ and uses it to log warnings. libregrtest uses the same stream to log unraisable exceptions and uncaught threading exceptions. Partially revert commit dbe213de7ef28712bbfdb9d94a33abb9c33ef0c2: libregrtest no longer replaces sys.__stdout__, sys.__stderr__, and stdout and stderr file descriptors. Remove also a few unused imports in libregrtest.
* bpo-45410: Enhance libregrtest -W/--verbose3 option (GH-28908)Victor Stinner2021-10-121-1/+3
| | | | | | | | | | | libregrtest -W/--verbose3 now also replace sys.__stdout__, sys.__stderr__, and stdout and stderr file descriptors (fd 1 and fd 2). support.print_warning() messages are now logged in the expected order. The "./python -m test test_eintr -W" command no longer logs into stdout if the test pass.
* bpo-45410: Add test.support.flush_std_streams() (GH-28885)Victor Stinner2021-10-111-0/+9
| | | support.print_warning() now flushs sys.stdout.
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)Serhiy Storchaka2021-09-301-43/+24
| | | | | | | | | | | | * Work correctly if an additional fresh module imports other additional fresh module which imports a blocked module. * Raises ImportError if the specified module cannot be imported while all additional fresh modules are successfully imported. * Support blocking packages. * Always restore the import state of fresh and blocked modules and their submodules. * Fix test_decimal and test_xml_etree which depended on an undesired side effect of import_fresh_module().
* [codemod] Fix non-matching bracket pairs (GH-28473)Mohamad Mansour2021-09-211-2/+2
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45229: Remove test_main in many tests (GH-28405)Serhiy Storchaka2021-09-191-8/+2
| | | | | | | | | Instead of explicitly enumerate test classes for run_unittest() use the unittest ability to discover tests. This also makes these tests discoverable and runnable with unittest. load_tests() can be used for dynamic generating tests and adding doctests. setUpModule(), tearDownModule() and addModuleCleanup() can be used for running code before and after all module tests.
* bpo-45020: Freeze os, site, and codecs. (gh-28398)Eric Snow2021-09-171-9/+9
| | | https://bugs.python.org/issue45020
* bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of ↵Eric Snow2021-09-142-3/+35
| | | | | | | frozen modules. (gh-28320) Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file. This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now. https://bugs.python.org/issue45020
* bpo-5846: Do not use obsolete unittest functions. (GH-28303)Serhiy Storchaka2021-09-132-3/+4
| | | | Get rid of use of makeSuite() and findTestCases(). Also make test_math and test_threading_local discoverable.
* bpo-45042: Now test classes decorated with `requires_hashdigest` are not ↵Nikita Sobolev2021-09-041-3/+16
| | | | | | skipped (GH-28060) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-45057: Simplify RegressionTestResult (GH-28081)Serhiy Storchaka2021-08-311-31/+2
| | | Remove code which duplicates the functionality of TextTestResult.
* bpo-44852: Support filtering over warnings without a set message (GH-27793)Łukasz Langa2021-08-181-4/+5
| | | | | | | | | | Additional improvements: - messages which were compiled regular expressions aren't unpacked back into strings for unmatched warnings; - removed unnecessary "if tokens:" check (there's one before the for loop); - took `endswith` calculation out of the for loop.
* bpo-44852: Support ignoring specific DeprecationWarnings wholesale in ↵Łukasz Langa2021-08-162-0/+39
| | | | regrtest (GH-27634)
* bpo-40928: notify users running test_decimal on macOS of malloc warnings ↵Jack DeVries2021-08-061-0/+18
| | | | | | | | (GH-26783) * When trying to allocate very large regions on macOS, malloc does not fail silently. It sends a noisy error out to STDERR * This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)Mariusz Felisiak2021-07-262-3/+3
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44708: Only re-run test methods that match names of previously failing ↵Łukasz Langa2021-07-221-1/+14
| | | | | | | | | | | test methods (GH-27287) * Move to a static argparse.Namespace subclass * Roughly annotate runtest.py * Refactor libregrtest to use lossless test result objects * Only re-run test methods that match names of previously failing test methods * Adopt tests to cover test method name matching Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-43950: Add option to opt-out of PEP-657 (GH-27023)Ammar Askar2021-07-071-0/+8
| | | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-11105: document the new test.support.infinite_recursion context manager ↵Batuhan Taskaya2021-06-081-1/+7
| | | | (GH-26604)
* bpo-11105: reduce the recursion limit for tests (GH-26550)Batuhan Taskaya2021-06-081-0/+9
|
* bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394)Erlend Egeberg Aasland2021-05-271-2/+2
|
* bpo-43988: Use check disallow instantiation helper (GH-26392)Erlend Egeberg Aasland2021-05-271-1/+7
|
* bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757)Erlend Egeberg Aasland2021-05-261-0/+11
|
* bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation ↵Lumír 'Frenzy' Balhar2021-04-231-0/+1
| | | | | | | | | | of the PEP) (GH-23142) This change: * merges `distutils.sysconfig` into `sysconfig` while keeping the original functionality and * marks `distutils.sysconfig` as deprecated https://bugs.python.org/issue41282
* bpo-41718: libregrtest avoids importing datetime (GH-24985)Victor Stinner2021-03-231-2/+1
| | | | * libregrtest reimplements datetime.timedelta.__str__() * support.testresult only imports datetime if USE_XML is true.
* bpo-41718: Disable support.testresult XML output by default (GH-24982)Victor Stinner2021-03-231-7/+18
| | | | | | | RegressionTestResult.USE_XML must now be set to True to get the JUnit XML output. Reduce the number of imports when --junit-xml=FILE option is not used: 153 => 144 (-9).
* bpo-42199: Fix bytecode_helper assertNotInBytecode (#23031)Max Bernstein2020-12-181-1/+2
| | | | | | | | | | * bpo-42199: Fix bytecode_helper assertNotInBytecode Add tests. * 📜🤖 Added by blurb_it. Co-authored-by: Dino Viehland <dinoviehland@fb.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-42639: Add script_helper.run_test_script() (GH-23777)Victor Stinner2020-12-151-0/+32
| | | | | | * Add run_test_script() function to test.support.script_helper. * Rename Lib/test/eintrdata/eintr_tester.py to Lib/test/_test_eintr.py. * test_eintr.py uses run_test_script().
* bpo-31904: add shell requirement for test_pipes (GH-23489)pxinwr2020-11-281-1/+1
| | | VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-1/+1
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-41521: Rename blacklist parameter to not_exported (GH-21824)Victor Stinner2020-08-171-5/+5
| | | | Rename "blacklist" parameter of test.support.check__all__() to "not_exported".
* bpo-40275: Remove test helpers aliases in test.support (GH-21771)Hai Shi2020-08-081-19/+4
|
* bpo-31904: Fix test_ftplib failures for VxWorks RTOS (GH-19447)pxinwr2020-07-271-0/+2
|
* bpo-36346: Make using the legacy Unicode C API optional (GH-21437)Serhiy Storchaka2020-07-101-0/+8
| | | | Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0 makes the interpreter not using the wchar_t cache and the legacy Unicode C API.
* bpo-41172: Fix check for compiler in test suite (GH-21400)Steve Dower2020-07-091-1/+7
|
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-252-11/+12
| | | | characters. (GH-21035)
* bpo-40275: Use new test.support helper submodules in tests (GH-20824)Hai Shi2020-06-251-1/+1
|
* bpo-40275: Use new test.support helper submodules in tests (GH-20849)Hai Shi2020-06-251-1/+1
|
* bpo-41043: Escape literal part of the path for glob(). (GH-20994)Serhiy Storchaka2020-06-201-1/+1
|
* bpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)Victor Stinner2020-06-191-8/+9
| | | | | skip_if_broken_multiprocessing_synchronize() only attempts for create a semaphore on Linux to fix multiprocessing test_resource_tracker_reused() on macOS.
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)Victor Stinner2020-06-181-0/+22
| | | | | | On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module.
* bpo-41009: fix requires_OS_version() class decorator (GH-20942)Christian Heimes2020-06-171-20/+19
| | | | | Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-41003: Fix test_copyreg when numpy is installed (GH-20935)Victor Stinner2020-06-171-0/+9
| | | | | | | | Fix test_copyreg when numpy is installed: test.pickletester now saves/restores warnings.filters when importing numpy, to ignore filters installed by numpy. Add the save_restore_warnings_filters() function to the test.support.warnings_helper module.
* bpo-32604: Clean up test.support.interpreters. (gh-20926)Eric Snow2020-06-171-79/+93
| | | | | There were some minor adjustments needed and a few tests were missing. https://bugs.python.org/issue32604
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-111-10/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.