Merge pull request 'chore(clan/pytest): discover all test files in the tree' (#3269) from hsjobeki/clan-core:lib-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3269
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
# this disables dynamic dependency loading in clan-cli
|
||||
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
|
||||
|
||||
from clan_cli.flake import Flake
|
||||
from clan_cli.machines.machines import Machine
|
||||
|
||||
@@ -24,7 +25,7 @@ from clan_cli.tests.fixtures_flakes import FlakeForTest
|
||||
indirect=True,
|
||||
)
|
||||
@pytest.mark.with_core
|
||||
def test_inventory_deserialize_variants(
|
||||
def test_inventory_machine_detect_class(
|
||||
test_flake_with_core: FlakeForTest,
|
||||
) -> None:
|
||||
"""
|
||||
@@ -212,7 +212,7 @@ pythonRuntime.pkgs.buildPythonApplication {
|
||||
# limit build cores to 16
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -41,6 +41,7 @@ norecursedirs = ["clan_cli/tests/helpers", "clan_cli/nixpkgs"]
|
||||
# and can be cached more effectively.
|
||||
markers = ["impure", "with_core"]
|
||||
filterwarnings = "default::ResourceWarning"
|
||||
python_files = ["test_*.py", "*_test.py"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.12"
|
||||
|
||||
Reference in New Issue
Block a user