Skip to content

test: cover single-page repository responses#10988

Open
LuBoys wants to merge 1 commit into
python-poetry:mainfrom
LuBoys:tests/single-page-repository-coverage
Open

test: cover single-page repository responses#10988
LuBoys wants to merge 1 commit into
python-poetry:mainfrom
LuBoys:tests/single-page-repository-coverage

Conversation

@LuBoys

@LuBoys LuBoys commented Jul 19, 2026

Copy link
Copy Markdown

Pull Request Check List

Relates-to: #3155

SinglePageRepository tests previously used a subclass that overrides _get_page, so the production implementation was not exercised.

This PR adds coverage for:

  • fetching and parsing the repository's single page;
  • raising PackageNotFoundError when the page returns a 404 response.

No production code or user-facing behavior is changed.

Testing

  • python -m pytest tests/repositories/test_single_page_repository.py --cov=poetry.repositories.single_page_repository --cov-report=term-missing -q — 5 passed, 100% coverage
  • python -m pytest tests/repositories --no-cov -q — 337 passed
  • python -m pytest --no-cov -q — 3175 passed, 27 skipped
  • pre-commit run --files tests/repositories/test_single_page_repository.py — passed
  • mypy tests/repositories/test_single_page_repository.py — passed

AI assistance

OpenAI Codex assisted with identifying the coverage gap, drafting the tests, and running validation. The contributor reviewed the complete diff and test results.

  • Added tests for changed code.
  • Updated documentation for changed code. Not applicable: this is a test-only change.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

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.

1 participant