Skip to content

Assert specific click.UsageError in package manager auto-detection test#10

Merged
MrLYC merged 2 commits intodevin/1770481980-add-uv-supportfrom
copilot/sub-pr-5-another-one
Feb 7, 2026
Merged

Assert specific click.UsageError in package manager auto-detection test#10
MrLYC merged 2 commits intodevin/1770481980-add-uv-supportfrom
copilot/sub-pr-5-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

The test_context_package_manager_none test was asserting a broad Exception type instead of the specific click.UsageError raised by Context.package_manager when no lock files are found.

Changes

  • Import click module in tests/test_main.py
  • Replace pytest.raises(Exception) with pytest.raises(click.UsageError, match="No uv.lock or poetry.lock found")

This prevents the test from masking unrelated failures and validates the exact error message.

# Before
with pytest.raises(Exception):
    ctx.package_manager

# After
with pytest.raises(click.UsageError, match="No uv.lock or poetry.lock found"):
    ctx.package_manager

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…tion

Co-authored-by: MrLYC <6391488+MrLYC@users.noreply.github.com>
Copilot AI changed the title [WIP] Update uv support implementation based on review feedback Assert specific click.UsageError in package manager auto-detection test Feb 7, 2026
Copilot AI requested a review from MrLYC February 7, 2026 18:10
@MrLYC MrLYC marked this pull request as ready for review February 7, 2026 18:36
@MrLYC MrLYC merged commit 697f6e2 into devin/1770481980-add-uv-support Feb 7, 2026
6 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.

2 participants