From 0d9cf82a032bfbf364d2e135d1181d233352a811 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Thu, 17 Aug 2023 11:27:29 +0200 Subject: [PATCH] added downstream testing to nox --- Makefile | 4 ++-- noxfile.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 47f7ad3..d62633e 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,8 @@ clean-test: ## remove test and coverage artifacts rm -fr htmlcov/ lint: ## reformat with black and check style with flake8 - black src tests - ruff src tests + black src tests noxfile.py + ruff src tests noxfile.py test: lint ## run tests quickly, stop on first error pytest tests -x -l --last-failed --disable-warnings -m "not functional" diff --git a/noxfile.py b/noxfile.py index fc22120..e44c239 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,3 +1,6 @@ +import pathlib +import tempfile + import nox @@ -6,3 +9,22 @@ def tests(session): session.install(".[test]") session.run("pytest", *session.posargs) + + +@nox.session(python=["3.9", "3.10", "3.11"]) +@nox.parametrize( + ("repo", "test_dir"), + [ + ("https://git.sgbio.de/Safeguard/mbp_hyb_calls", "tests"), + ], +) +def downstream(session, repo, test_dir): + session.install(".") + + with tempfile.TemporaryDirectory() as tmpdir: + session.run("git", "clone", repo, tmpdir, external=True) + + session.install(f"{tmpdir}[test]") + + test_path = pathlib.Path(tmpdir) / test_dir + session.run("pytest", test_path)