pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://github.com/python/cpython/issues/110171

ttps://github.githubassets.com/assets/repository-6ec84ae2261fecf8.css" /> `libregrtest` should always set `random.seed` · Issue #110171 · python/cpython · GitHub
Skip to content

libregrtest should always set random.seed #110171

@sobolevn

Description

@sobolevn

Feature or enhancement

While working on #110160 I've noticed that it is rather hard to reproduce random test failures. So, I want to propose a new feature / fix for that.

First of all, there's existing prior work of @vstinner who added --randseed flag.
Right now it is used together with -r to randomize test order and seeding random.

I propose to:

  • Split --randseed into two options: test order randomization and random.seed usage
  • Let's keep -r as-is
  • Let's add --no-use-randseed flag to disable setting random.seed, let's always seed random by default
  • Always print information about current random seed to be able to reuse it in the next runs

Example:

» ./python.exe -m test test_regrtest
Using random seed 65906482
0:00:00 load avg: 1.55 Run 1 test sequentially
0:00:00 load avg: 1.55 [1/1] test_regrtest

== Tests result: SUCCESS ==

1 test OK.

Total duration: 12.7 sec
Total tests: run=102 skipped=2
Total test files: run=1/1
Result: SUCCESS

Basically, this is how https://github.com/pytest-dev/pytest-randomly works.

I have a PR ready.

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





    Check this box to remove all script contents from the fetched content.



    Check this box to remove all images from the fetched content.


    Check this box to remove all CSS styles from the fetched content.


    Check this box to keep images inefficiently compressed and original size.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy