Skip to content

Commit 5766e1f

Browse files
Enhance copy test to verify all config fields are preserved
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/8e4db7cc-5876-49e5-9601-e64a0a24f831 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
1 parent 657137d commit 5766e1f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/usethis/test_config.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from usethis._config import UsethisConfig, usethis_config
77
from usethis._test import change_cwd
88
from usethis._types.backend import BackendEnum
9+
from usethis._types.build_backend import BuildBackendEnum
910
from usethis.errors import ForbiddenBackendError
1011

1112

@@ -40,6 +41,14 @@ def test_preserves_modified_values(self):
4041
config.offline = True
4142
config.quiet = True
4243
config.frozen = True
44+
config.alert_only = True
45+
config.instruct_only = True
46+
config.backend = BackendEnum.uv
47+
config.inferred_backend = BackendEnum.uv
48+
config.build_backend = BuildBackendEnum.uv
49+
config.disable_pre_commit = True
50+
config.subprocess_verbose = True
51+
config.project_dir = Path("/some/project")
4352

4453
# Act
4554
copied = config.copy()
@@ -48,6 +57,14 @@ def test_preserves_modified_values(self):
4857
assert copied.offline is True
4958
assert copied.quiet is True
5059
assert copied.frozen is True
60+
assert copied.alert_only is True
61+
assert copied.instruct_only is True
62+
assert copied.backend is BackendEnum.uv
63+
assert copied.inferred_backend is BackendEnum.uv
64+
assert copied.build_backend is BuildBackendEnum.uv
65+
assert copied.disable_pre_commit is True
66+
assert copied.subprocess_verbose is True
67+
assert copied.project_dir == Path("/some/project")
5168

5269
def test_independent_of_original(self):
5370
# Arrange

0 commit comments

Comments
 (0)