]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109276: libregrtest calls random.seed() before each test (#109279)
authorVictor Stinner <vstinner@python.org>
Tue, 12 Sep 2023 03:35:08 +0000 (05:35 +0200)
committerGitHub <noreply@github.com>
Tue, 12 Sep 2023 03:35:08 +0000 (05:35 +0200)
commita84cb74d42a28cf8e72ed7b5d9412fc13d18c817
treea3d007a2718db76fc6cca4ed21c00ae84c1b440c
parent4e77645986fd27beaf25779426ae8580009fae33
gh-109276: libregrtest calls random.seed() before each test (#109279)

libregrtest now calls random.seed() before running each test file
when -r/--randomize command line option is used. Moreover, it's also
called in worker processes. It should help to make tests more
deterministic. Previously, it was only called once in the main
process before running all test files and it was not called in worker
processes.

* Convert some f-strings to regular strings in test_regrtest when
  f-string is not needed.
* Remove unused all_methods variable from test_regrtest.
* Add RunTests members are now mandatory.
Lib/test/libregrtest/main.py
Lib/test/libregrtest/runtests.py
Lib/test/libregrtest/setup.py
Lib/test/test_regrtest.py
Misc/NEWS.d/next/Tests/2023-09-11-19-11-57.gh-issue-109276.qxI4OG.rst [new file with mode: 0644]