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
4 changes: 2 additions & 2 deletions src/poetry/console/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ def _hint_update_packages(self) -> str:

def notify_about_existing_packages(self, existing_packages: list[str]) -> None:
self.line(
"The following packages are already present in the pyproject.toml and will"
" be skipped:\n"
f"The following packages are already present in the pyproject.toml"
f" (<c2>{self.poetry.file.path}</c2>) and will be skipped:\n"
)
for name in existing_packages:
self.line(f" - <c1>{name}</c1>")
Expand Down
4 changes: 2 additions & 2 deletions tests/console/commands/self/test_add_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def test_add_existing_plugin_warns_about_no_operation(

assert isinstance(tester.command, AddCommand)
expected = f"""\
The following packages are already present in the pyproject.toml and will be\
skipped:
The following packages are already present in the pyproject.toml\
({tester.command.poetry.file.path}) and will be skipped:

- poetry-plugin
{tester.command._hint_update_packages}
Expand Down
10 changes: 6 additions & 4 deletions tests/console/commands/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,8 +1416,9 @@ def test_add_should_skip_when_adding_existing_package_with_no_constraint(
repo.add_package(get_package("foo", "1.1.2"))
tester.execute("foo")

expected = """\
The following packages are already present in the pyproject.toml and will be skipped:
expected = f"""\
The following packages are already present in the pyproject.toml\
({app.poetry.file.path}) and will be skipped:

- foo

Expand Down Expand Up @@ -1447,8 +1448,9 @@ def test_add_should_skip_when_adding_canonicalized_existing_package_with_no_cons
repo.add_package(get_package("foo-bar", "1.1.2"))
tester.execute("Foo_Bar")

expected = """\
The following packages are already present in the pyproject.toml and will be skipped:
expected = f"""\
The following packages are already present in the pyproject.toml\
({app.poetry.file.path}) and will be skipped:

- Foo_Bar

Expand Down
Loading