chore(clan/pytest): discover all test files in the tree
This commit is contained in:
@@ -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 $@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
"""
|
"""
|
||||||
@@ -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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user