Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/usethis/_core/author.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from usethis._console import tick_print
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
from usethis._integrations.uv.init import ensure_pyproject_toml

Expand All @@ -11,6 +12,8 @@ def add_author(
):
ensure_pyproject_toml(author=False)

tick_print(f"Setting '{name}' as an author.")

if email is not None:
values = [{"name": name, "email": email}]
else:
Expand Down
5 changes: 4 additions & 1 deletion tests/usethis/_core/test_author.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class TestAddAuthor:
def test_no_authors_yet(self, tmp_path: Path):
def test_no_authors_yet(self, tmp_path: Path, capfd: pytest.CaptureFixture[str]):
# Arrange
(tmp_path / "pyproject.toml").touch()

Expand All @@ -32,6 +32,9 @@ def test_no_authors_yet(self, tmp_path: Path):
email = "jc@example.com"
"""
)
out, err = capfd.readouterr()
assert out == "✔ Setting 'John Cleese' as an author.\n"
assert not err

def test_append(self, tmp_path: Path):
# Arrange
Expand Down
Loading