Skip to content

Commit 7e2ef06

Browse files
committed
Don't allow pytest-subtests to upgrade pytest
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 4634f81 commit 7e2ef06

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.pylint-spelling-words

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ sids
6464
sitevars
6565
smartos
6666
str
67+
subtests
6768
sunos
6869
sys
6970
toml

noxfile.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,16 @@ def tests(session):
129129
session.install(COVERAGE_VERSION_REQUIREMENT, silent=PIP_INSTALL_SILENT)
130130
pytest_version_requirement = os.environ.get("PYTEST_VERSION_REQUIREMENT") or None
131131
if pytest_version_requirement:
132+
# Account that, under CI, when we test previous version of pytest
133+
# we need to pin pytest-subtests to a lower version so that pytest
134+
# itself does not get upgraded
135+
pytest_requirements = []
132136
if not pytest_version_requirement.startswith("pytest"):
133137
pytest_version_requirement = "pytest{}".format(pytest_version_requirement)
134-
session.install(pytest_version_requirement, silent=PIP_INSTALL_SILENT)
138+
pytest_requirements.append(pytest_version_requirement)
139+
if pytest_version_requirement.startswith("pytest~=6"):
140+
pytest_requirements.append("pytest-subtests<0.7.0")
141+
session.install(*pytest_requirements, silent=PIP_INSTALL_SILENT)
135142
session.install("-e", ".", silent=PIP_INSTALL_SILENT)
136143
session.install("-r", os.path.join("requirements", "base.txt"), silent=PIP_INSTALL_SILENT)
137144
session.install("-r", os.path.join("requirements", "tests.txt"), silent=PIP_INSTALL_SILENT)

0 commit comments

Comments
 (0)