From fa3b761054bcd3d600dbcc92244621a24271faac Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 2 Jun 2021 16:27:04 +0200 Subject: [PATCH] Remove pytest-randomly from the dev dependencies - problem: because of the randomization of test cases, every once in a while, the schema holding the test db already exists and cannot be created a second time (background: we run all tests against a db created with `metadate.create_all()` by SQLAlchemy at once and a db created by running all incremental Alchemy migration scripts) - quick fix: possible, we could find a way to run all tests against one of the two test db's in random order and then against the other => in the interest of time, we simply do not randomize the test cases --- noxfile.py | 5 +---- poetry.lock | 17 +---------------- pyproject.toml | 1 - 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/noxfile.py b/noxfile.py index eac123e..0aca0c5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -197,7 +197,6 @@ def test(session): 'pytest-cov', 'pytest-env', 'pytest-mock', - 'pytest-randomly', 'xdoctest[optional]', ) @@ -207,7 +206,7 @@ def test(session): # test cases that require the slow installation of R and some packages. if session.env.get('_slow_ci_tests'): session.run( - 'pytest', '--randomly-seed=4287', '-m', 'r and not db', PYTEST_LOCATION, + 'pytest', '-m', 'r and not db', PYTEST_LOCATION, ) # In the "ci-tests-slow" session, we do not run any test tool @@ -219,7 +218,6 @@ def test(session): # Therefore, the CI server does not measure coverage. elif session.env.get('_fast_ci_tests'): pytest_args = ( - '--randomly-seed=4287', '-m', 'not (db or r)', PYTEST_LOCATION, @@ -235,7 +233,6 @@ def test(session): '--cov-branch', '--cov-fail-under=100', '--cov-report=term-missing:skip-covered', - '--randomly-seed=4287', PYTEST_LOCATION, ) diff --git a/poetry.lock b/poetry.lock index dfa7291..4949972 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1473,17 +1473,6 @@ pytest = ">=5.0" [package.extras] dev = ["pre-commit", "tox", "pytest-asyncio"] -[[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" @@ -2037,7 +2026,7 @@ research = ["jupyterlab", "nb_black", "numpy", "pytz"] [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "72f0b0200c4726e385a2ac8d4a4bce2cb194403700d0e48044592c9add81e3d5" +content-hash = "f4dfe432ca7054f9be0e2ab189d3f6cd210dc51a2c2f2ded8b7d978620de9b51" [metadata.files] alabaster = [ @@ -2800,10 +2789,6 @@ pytest-mock = [ {file = "pytest-mock-3.5.1.tar.gz", hash = "sha256:a1e2aba6af9560d313c642dae7e00a2a12b022b80301d9d7fc8ec6858e1dd9fc"}, {file = "pytest_mock-3.5.1-py3-none-any.whl", hash = "sha256:379b391cfad22422ea2e252bdfc008edd08509029bcde3c25b2c0bd741e0424e"}, ] -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"}, diff --git a/pyproject.toml b/pyproject.toml index df53244..6d918e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,6 @@ pytest = "^6.0.1" pytest-cov = "^2.10.0" pytest-env = "^0.6.2" pytest-mock = "^3.5.1" -pytest-randomly = "^3.5.0" xdoctest = { version="^0.13.0", extras=["optional"] } # Documentation