From 810a2c67f93775eda1370c073e8d50a0fa5d604b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Aug 2025 16:33:11 +0200 Subject: [PATCH 1/3] clan-cli/machines/list: mark test as pure --- pkgs/clan-cli/clan_cli/machines/list_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/machines/list_test.py b/pkgs/clan-cli/clan_cli/machines/list_test.py index f0715bc25..3144ff167 100644 --- a/pkgs/clan-cli/clan_cli/machines/list_test.py +++ b/pkgs/clan-cli/clan_cli/machines/list_test.py @@ -125,7 +125,7 @@ def list_with_tags_multiple_tags_intersection( assert "dev-machine" not in output.out -@pytest.mark.impure +@pytest.mark.with_core def test_machines_list_with_tags_no_matches( test_flake_with_core: fixtures_flakes.FlakeForTest, capture_output: CaptureOutput, From 96014c02c538f2c6d49ce40d2d6f19de18bb6e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Aug 2025 16:35:25 +0200 Subject: [PATCH 2/3] clan-cli/templates: mark tests as pure --- pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py index 1224590b1..21e769956 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py +++ b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py @@ -9,7 +9,7 @@ from clan_lib.templates import list_templates from clan_lib.templates.filesystem import copy_from_nixstore -@pytest.mark.impure +@pytest.mark.with_core def test_copy_from_nixstore_symlink( monkeypatch: pytest.MonkeyPatch, temporary_home: Path ) -> None: @@ -30,7 +30,7 @@ def test_copy_from_nixstore_symlink( assert (dest / "file.txt").is_symlink() -@pytest.mark.impure +@pytest.mark.with_core def test_clan_core_templates( test_flake_with_core: FlakeForTest, monkeypatch: pytest.MonkeyPatch, From 9cdc6a27b624240c4fac92578f5e5c2f1b0931b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Aug 2025 16:53:39 +0200 Subject: [PATCH 3/3] test_copy_from_nixstore_symlink: drop test. seems a bit overkill to have a test for two lines of python code... --- .../clan_cli/tests/test_clan_nix_attrset.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py index 21e769956..c7cab612c 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py +++ b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py @@ -2,34 +2,11 @@ from pathlib import Path import pytest from clan_cli.tests.fixtures_flakes import FlakeForTest -from clan_lib.cmd import run from clan_lib.flake import Flake -from clan_lib.nix import nix_command from clan_lib.templates import list_templates from clan_lib.templates.filesystem import copy_from_nixstore -@pytest.mark.with_core -def test_copy_from_nixstore_symlink( - monkeypatch: pytest.MonkeyPatch, temporary_home: Path -) -> None: - src = temporary_home / "src" - src.mkdir() - (src / "file.txt").write_text("magicstring!") - res = run(nix_command(["store", "add", str(src)])) - src_nix = Path(res.stdout.strip()) - src2 = temporary_home / "src2" - src2.mkdir() - (src2 / "file.txt").symlink_to(src_nix / "file.txt") - res = run(nix_command(["store", "add", str(src2)])) - src2_nix = Path(res.stdout.strip()) - dest = temporary_home / "dest" - copy_from_nixstore(src2_nix, dest) - assert (dest / "file.txt").exists() - assert (dest / "file.txt").read_text() == "magicstring!" - assert (dest / "file.txt").is_symlink() - - @pytest.mark.with_core def test_clan_core_templates( test_flake_with_core: FlakeForTest,