Commit graph

7 commits

Author SHA1 Message Date
Victor Stinner
ec5743b5f2
[3.12] gh-119050: Add XML support to libregrtest refleak checker (#119148) (#119272)
gh-119050: Add XML support to libregrtest refleak checker (#119148)

regrtest test runner: Add XML support to the refleak checker
(-R option).

* run_unittest() now stores XML elements as string, rather than
  objects, in support.junit_xml_list.
* runtest_refleak() now saves/restores XML strings before/after
  checking for reference leaks. Save XML into a temporary file.

(cherry picked from commit 9257731f5d)
2024-05-20 22:56:34 +00:00
Miss Islington (bot)
8d21242bd1
[3.12] gh-108927: Fix removing testing modules from sys.modules (GH-108952) (ПР-112711)
It breaks import machinery if the test module has submodules used in
other tests.
(cherry picked from commit e08b70fab1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-04 16:17:38 +00:00
Alex Waygood
36dbebed44
[3.12] gh-109413: libregrtest: enable mypy's --strict-optional check on most files (#112586) (#112602)
gh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (#112586)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-01 17:13:22 +00:00
Miss Islington (bot)
5089faf954
[3.12] gh-111881: Import doctest lazily in libregrtest (GH-111884) (#111893)
gh-111881: Import doctest lazily in libregrtest (GH-111884)

In most cases, doctest is not needed. So don't always import it at
startup. The change reduces the number of modules already
imported when a test is run.
(cherry picked from commit 6f09f69b7f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-09 15:40:10 +00:00
Miss Islington (bot)
3641dae42f
[3.12] gh-111165: Add missed "support." prefix for "verbose" (GH-111327) (GH-111328)
(cherry picked from commit a4981921aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 15:28:07 +00:00
Serhiy Storchaka
5c4f9a1c7e
[3.12] gh-111165: Move test running code from test.support to libregrtest (GH-111166) (GH-111316)
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
(cherry picked from commit f6a45a03d0)
2023-10-25 14:56:27 +03:00
Victor Stinner
4b7a12db54
[3.12] gh-110756: Sync regrtest with main branch (#110758)
gh-110756: Sync regrtest with main branch

Copy files from main to this branch:

* Lib/test/libregrtest/*.py
* Lib/test/__init__.py
* Lib/test/__main__.py
* Lib/test/autotest.py
* Lib/test/pythoninfo.py
* Lib/test/regrtest.py
* Lib/test/test_regrtest.py

Do not modify scripts running tests such as Makefile.pre.in,
.github/workflows/build.yml or Tools/scripts/run_tests.py: do not use
--fast-ci and --slow-ci in this change.

Changes:

* SPLITTESTDIRS: don't include test_inspect.
* Add utils.process_cpu_count() using len(os.sched_getaffinity(0)).
* test_regrtest doesn't use @support.without_optimizer which doesn't
  exist in Python 3.12.
* Add support.set_sanitizer_env_var().
* Update test_faulthandler to use support.set_sanitizer_env_var().
2023-10-12 22:03:07 +02:00