Skip to content

tests: make test independent of system pythons#10817

Merged
radoering merged 1 commit intopython-poetry:mainfrom
radoering:fix-test-list-poetry-managed
Apr 3, 2026
Merged

tests: make test independent of system pythons#10817
radoering merged 1 commit intopython-poetry:mainfrom
radoering:fix-test-list-poetry-managed

Conversation

@radoering
Copy link
Copy Markdown
Member

The column width of the output may vary depending on the available system pythons.

Pull Request Check List

Resolves: #10796

  • Added tests for changed code.
  • Updated documentation for changed code.

The column width of the output may vary depending on the available system pythons.
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The inline loop that manually registers poetry-managed interpreters in test_list_poetry_managed is fairly verbose and duplicates knowledge about the directory structure and flags; consider extracting a small helper fixture or function to encapsulate this setup so the test focuses on behavior rather than filesystem details.
  • You now build expected_system and expected_poetry sets directly from hard-coded strings; if the output formatting changes (e.g., column widths or labels), these assertions may become brittle—consider deriving expected lines from the same parameters used for registration (versions, implementations, paths) or using a looser comparison that validates the key fields without depending on spacing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The inline loop that manually registers poetry-managed interpreters in `test_list_poetry_managed` is fairly verbose and duplicates knowledge about the directory structure and flags; consider extracting a small helper fixture or function to encapsulate this setup so the test focuses on behavior rather than filesystem details.
- You now build `expected_system` and `expected_poetry` sets directly from hard-coded strings; if the output formatting changes (e.g., column widths or labels), these assertions may become brittle—consider deriving expected lines from the same parameters used for registration (versions, implementations, paths) or using a looser comparison that validates the key fields without depending on spacing.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@radoering radoering enabled auto-merge (squash) April 3, 2026 09:31
@radoering radoering disabled auto-merge April 3, 2026 09:31
@radoering radoering merged commit 560b9c2 into python-poetry:main Apr 3, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_list_poetry_managed[False] test failing over whitespace differences

1 participant