diff --git a/noxfile.py b/noxfile.py index e0b4ca9e..75b71f96 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,18 +2,18 @@ @nox.session -def lint(session: nox.Session): +def tests(session: nox.Session): session.install("favicons") # TODO: remove - session.install(".[test]", "nox", "pyright") + session.install("pyright", "nox") + session.install("-e", ".[test]", "-e", "./test/_submodules/HexMod") session.run("pyright", "--warnings") - -@nox.session -def tests(session: nox.Session): - session.install("favicons") # TODO: remove - session.install(".[test]", "./test/_submodules/HexMod") + session.run("hexdoc", "export", "--props", "properties.toml") + session.run( + "hexdoc", "export", "--props", "test/_submodules/HexMod/doc/properties.toml" + ) # test cookiecutter last so the extra package install doesn't interfere - session.run("pytest", "-k", "not test_cookiecutter") - session.run("pytest", "-k", "test_cookiecutter") + session.run("pytest", *session.posargs) + session.run("pytest", "-k", "test_cookiecutter", "--nox", *session.posargs) diff --git a/test/_submodules/HexMod b/test/_submodules/HexMod index 0d76e88a..f229e4f8 160000 --- a/test/_submodules/HexMod +++ b/test/_submodules/HexMod @@ -1 +1 @@ -Subproject commit 0d76e88a6b2d9ebe8704a887e30c645003168ee8 +Subproject commit f229e4f8ae178f54ccae9a046551d8d2e0643e45 diff --git a/test/conftest.py b/test/conftest.py index 626e5637..9f6a4965 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -10,6 +10,7 @@ from hexdoc.plugin import PluginManager longrun = pytest.mark.skipif("not config.getoption('longrun')") +nox_only = pytest.mark.skipif("not config.getoption('nox')") # https://stackoverflow.com/a/43938191 @@ -20,6 +21,12 @@ def pytest_addoption(parser: Parser): dest="longrun", help="disable longrun-decorated tests", ) + parser.addoption( + "--nox", + action="store_true", + dest="nox", + help="enable nox_only-decorated tests", + ) class FilePathSnapshotExtension(SingleFileSnapshotExtension): diff --git a/test/test_cookiecutter.py b/test/test_cookiecutter.py index 5f2e9b46..3ffa1a8a 100644 --- a/test/test_cookiecutter.py +++ b/test/test_cookiecutter.py @@ -11,10 +11,10 @@ from hexdoc._cli.app import render -from .conftest import longrun +from .conftest import nox_only -@longrun +@nox_only def test_cookiecutter(cookies: Cookies, monkeypatch: MonkeyPatch): result = cookies.bake( {