Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
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
--randseedinto two options: test order randomization andrandom.seedusage - Let's keep
-ras-is - Let's add
--no-use-randseedflag to disable settingrandom.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_regrtestUsing random seed 659064820:00:00 load avg: 1.55 Run 1 test sequentially0:00:00 load avg: 1.55 [1/1] test_regrtest== Tests result: SUCCESS ==1 test OK.Total duration: 12.7 secTotal tests: run=102 skipped=2Total test files: run=1/1Result: SUCCESSBasically, this is howhttps://github.com/pytest-dev/pytest-randomly works.
I have a PR ready.