Reset random.seed() before every test case
This commit is contained in:
parent
4c0c7887e5
commit
3d9f990c68
3 changed files with 22 additions and 1 deletions
|
|
@ -230,11 +230,14 @@ TEST_DEPENDENCIES = (
|
|||
"packaging",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-randomly",
|
||||
"semver",
|
||||
'typing-extensions; python_version < "3.11"', # to support Python 3.9 & 3.10
|
||||
"xdoctest",
|
||||
)
|
||||
|
||||
TEST_RANDOM_SEED = "--randomly-seed=42"
|
||||
|
||||
|
||||
@nox.session(python=SUPPORTED_PYTHONS)
|
||||
def test(session: nox.Session) -> None:
|
||||
|
|
@ -250,6 +253,7 @@ def test(session: nox.Session) -> None:
|
|||
args = posargs or (
|
||||
"--cov",
|
||||
"--no-cov-on-fail",
|
||||
TEST_RANDOM_SEED,
|
||||
TESTS_LOCATION,
|
||||
)
|
||||
|
||||
|
|
@ -294,6 +298,7 @@ def test_coverage_run(session: nox.Session) -> None:
|
|||
"run",
|
||||
"-m",
|
||||
"pytest",
|
||||
TEST_RANDOM_SEED,
|
||||
TESTS_LOCATION,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue