Skip to content

Commit

Permalink
revert/fix changes to test
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb authored and neersighted committed Oct 29, 2022
1 parent b2fbc85 commit 36088ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/poetry/console/commands/show.py
Expand Up @@ -211,7 +211,7 @@ def _display_packages_information(
with solver.use_environment(self.env):
ops = solver.solve().calculate_operations()

required_locked_packages = {op.package for op in ops if not op.skipped}
required_locked_packages = {op.package.name for op in ops if not op.skipped}

show_latest = self.option("latest")
show_all = self.option("all")
Expand All @@ -223,7 +223,7 @@ def _display_packages_information(

# Computing widths
for locked in locked_packages:
if locked not in required_locked_packages and not show_all:
if locked.name not in required_locked_packages and not show_all:
continue

current_length = len(locked.pretty_name)
Expand Down Expand Up @@ -300,7 +300,7 @@ def _display_packages_information(
color = "cyan"
name = locked.pretty_name
install_marker = ""
if locked not in required_locked_packages:
if locked.name not in required_locked_packages:
if not show_all:
continue

Expand Down
5 changes: 4 additions & 1 deletion tests/console/commands/test_show.py
Expand Up @@ -1041,7 +1041,10 @@ def test_show_outdated_local_dependencies(

tester.execute("--outdated")

expected = """cachy 0.2.0 0.3.0 Cachy package"""
expected = """\
cachy 0.2.0 0.3.0
project-with-setup 0.1.1 ../project_with_setup 0.1.2 ../project_with_setup
"""
assert (
"\n".join(line.rstrip() for line in tester.io.fetch_output().splitlines())
== expected.rstrip()
Expand Down

0 comments on commit 36088ff

Please sign in to comment.