chore(clan/pytest): discover all test files in the tree

This commit is contained in:
Johannes Kirschbauer
2025-04-09 18:54:57 +02:00
parent ab9c0d2904
commit de587648f8
4 changed files with 5 additions and 3 deletions

View File

@@ -30,7 +30,7 @@
# this disables dynamic dependency loading in clan-cli # this disables dynamic dependency loading in clan-cli
export CLAN_NO_DYNAMIC_DEPS=1 export CLAN_NO_DYNAMIC_DEPS=1
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -m impure ./clan_cli/tests $@" nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -m impure ./clan_cli $@"
''; '';
}; };
} }

View File

@@ -1,4 +1,5 @@
import pytest import pytest
from clan_cli.flake import Flake from clan_cli.flake import Flake
from clan_cli.machines.machines import Machine from clan_cli.machines.machines import Machine
@@ -24,7 +25,7 @@ from clan_cli.tests.fixtures_flakes import FlakeForTest
indirect=True, indirect=True,
) )
@pytest.mark.with_core @pytest.mark.with_core
def test_inventory_deserialize_variants( def test_inventory_machine_detect_class(
test_flake_with_core: FlakeForTest, test_flake_with_core: FlakeForTest,
) -> None: ) -> None:
""" """

View File

@@ -212,7 +212,7 @@ pythonRuntime.pkgs.buildPythonApplication {
# limit build cores to 16 # limit build cores to 16
jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))" jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))"
python -m pytest -m "not impure and with_core" ./clan_cli/tests -n $jobs python -m pytest -m "not impure and with_core" ./clan_cli -n $jobs
touch $out touch $out
''; '';
}; };

View File

@@ -41,6 +41,7 @@ norecursedirs = ["clan_cli/tests/helpers", "clan_cli/nixpkgs"]
# and can be cached more effectively. # and can be cached more effectively.
markers = ["impure", "with_core"] markers = ["impure", "with_core"]
filterwarnings = "default::ResourceWarning" filterwarnings = "default::ResourceWarning"
python_files = ["test_*.py", "*_test.py"]
[tool.mypy] [tool.mypy]
python_version = "3.12" python_version = "3.12"