Skip to content

Commit 2c58170

Browse files
Add missing PyprojectTOMLManager manager and test (#365)
1 parent 4fb32f5 commit 2c58170

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/usethis/_interface/tool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ def coverage(
5151
quiet: bool = quiet_opt,
5252
frozen: bool = frozen_opt,
5353
) -> None:
54-
with usethis_config.set(offline=offline, quiet=quiet, frozen=frozen):
54+
with (
55+
usethis_config.set(offline=offline, quiet=quiet, frozen=frozen),
56+
PyprojectTOMLManager(),
57+
):
5558
_run_tool(use_coverage, remove=remove)
5659

5760

tests/usethis/_interface/test_tool.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ def test_add(self, tmp_path: Path):
2626
assert result.exit_code == 0, result.output
2727

2828

29+
class TestCoverage:
30+
@pytest.mark.usefixtures("_vary_network_conn")
31+
def test_cli(self, uv_init_dir: Path):
32+
with change_cwd(uv_init_dir):
33+
if not usethis_config.offline:
34+
call_subprocess(["usethis", "tool", "coverage"])
35+
else:
36+
call_subprocess(["usethis", "tool", "coverage", "--offline"])
37+
38+
2939
class TestDeptry:
3040
@pytest.mark.usefixtures("_vary_network_conn")
3141
def test_cli(self, uv_init_dir: Path):

0 commit comments

Comments
 (0)