-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dir
Description
#135326 exposed the fact that there was no tests for objects implementing __index__
in test_random
, even if some code in the random
module explicitly support them.
When trying to add more tests, I discovered that
- Some code is literally duplicated for Random and SystemRandom tests. It is easy to make error by modifying only only one of the copy.
- As consequence of this, some tests were only added for SystemRandom, even if they are not specific for SystemRandom.
There was also no tests for randint()
.
So the following PR reorganizes test_random
: removes duplicated code, makes sure that implementation agnostic tests are run for both classes, and add few new tests.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dir