Skip to content

Commit

Permalink
Let function doctest of the noxfile module use the `_clean_enviro…
Browse files Browse the repository at this point in the history
…nment` context manager after updating all dependencies.

Fixes #149

(cherry picked from commit 3283533)
  • Loading branch information
tyralla committed Jan 14, 2025
1 parent f417c33 commit 261a6dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def doctest(session: nox.Session, numpy: Literal["1", "2"]) -> None:
shutil.copy(
"hydpy/tests/hydpydoctestcustomize.pth", "hydpydoctestcustomize.pth"
)
if numpy == "1":
session.run("pip", "install", "numpy<2")
elif numpy == "2":
session.run("pip", "install", "numpy>1,<3")
else:
assert_never(numpy)
with _clean_environment(session):
if numpy == "1":
session.run("pip", "install", "numpy<2")
elif numpy == "2":
session.run("pip", "install", "numpy>1,<3")
else:
assert_never(numpy)
session.run("python", "hydpy/tests/run_doctests.py", *session.posargs)
if not session.posargs:
session.run("coverage", "combine")
Expand Down

0 comments on commit 261a6dc

Please # to comment.