Skip to content

Commit 2984165

Browse files
Test codespell message isn't duplicated. (#531)
1 parent 127f87f commit 2984165

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/usethis/_core/test_core_tool.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,24 @@ def test_codespell_rc_file(self, uv_init_dir: Path):
174174
"""
175175
)
176176

177+
def test_adding_twice(
178+
self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
179+
):
180+
# https://github.com/nathanjmcdougall/usethis-python/issues/509
181+
182+
with change_cwd(uv_init_dir), files_manager():
183+
# Arrange
184+
use_codespell()
185+
capfd.readouterr()
186+
187+
# Act
188+
use_codespell()
189+
190+
# Assert
191+
out, err = capfd.readouterr()
192+
assert not err
193+
assert out == ("☐ Run 'codespell' to run the Codespell spellchecker.\n")
194+
177195
class TestRemove:
178196
@pytest.mark.usefixtures("_vary_network_conn")
179197
def test_config_file(

0 commit comments

Comments
 (0)