Integrate pytest-randomly into the test suite
As a lot of the integration tests populate the database with test data, it is deemed safer to run the tests in random order to uncover potential dependencies between distinct test cases. Because of how the `db_session` fixture is designed, this should already be taken care of.
This commit is contained in:
parent
b9c3697434
commit
0aefa22666
3 changed files with 19 additions and 1 deletions
|
@ -226,6 +226,7 @@ def test(session):
|
|||
'pytest',
|
||||
'pytest-cov',
|
||||
'pytest-env',
|
||||
'pytest-randomly',
|
||||
'xdoctest[optional]',
|
||||
)
|
||||
|
||||
|
@ -240,6 +241,7 @@ def test(session):
|
|||
'--cov-branch',
|
||||
'--cov-fail-under=100',
|
||||
'--cov-report=term-missing:skip-covered',
|
||||
'--randomly-seed=4287',
|
||||
'-k',
|
||||
'not e2e',
|
||||
PYTEST_LOCATION,
|
||||
|
|
17
poetry.lock
generated
17
poetry.lock
generated
|
@ -1335,6 +1335,17 @@ python-versions = "*"
|
|||
[package.dependencies]
|
||||
pytest = ">=2.6.0"
|
||||
|
||||
[[package]]
|
||||
name = "pytest-randomly"
|
||||
version = "3.5.0"
|
||||
description = "Pytest plugin to randomly order tests and control random.seed."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.dependencies]
|
||||
pytest = "*"
|
||||
|
||||
[[package]]
|
||||
name = "python-dateutil"
|
||||
version = "2.8.1"
|
||||
|
@ -1806,7 +1817,7 @@ research = ["jupyterlab", "nb_black", "numpy", "pandas", "pytz"]
|
|||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "5f49faba0f11ddf2c4439fe0aad8113a68cbd504b2f68e57dfbec38db3cbe474"
|
||||
content-hash = "28c08518fa365282d2b06ea2b78784906c69114f05da597ba5df4bcc64fe4aaa"
|
||||
|
||||
[metadata.files]
|
||||
alabaster = [
|
||||
|
@ -2463,6 +2474,10 @@ pytest-cov = [
|
|||
pytest-env = [
|
||||
{file = "pytest-env-0.6.2.tar.gz", hash = "sha256:7e94956aef7f2764f3c147d216ce066bf6c42948bb9e293169b1b1c880a580c2"},
|
||||
]
|
||||
pytest-randomly = [
|
||||
{file = "pytest-randomly-3.5.0.tar.gz", hash = "sha256:440cec143fd9b0adeb072006c71e0294402a2bc2ccd08079c2341087ba4cf2d1"},
|
||||
{file = "pytest_randomly-3.5.0-py3-none-any.whl", hash = "sha256:9db10d160237f3f8ee60cef72e4cb9ea88d2893c9dd5c8aa334b060cdeb67c3a"},
|
||||
]
|
||||
python-dateutil = [
|
||||
{file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"},
|
||||
{file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"},
|
||||
|
|
|
@ -75,6 +75,7 @@ packaging = "^20.4" # used to test the packaged version
|
|||
pytest = "^6.0.1"
|
||||
pytest-cov = "^2.10.0"
|
||||
pytest-env = "^0.6.2"
|
||||
pytest-randomly = "^3.5.0"
|
||||
xdoctest = { version="^0.13.0", extras=["optional"] }
|
||||
|
||||
# Documentation
|
||||
|
|
Loading…
Reference in a new issue