Skip to content

tests: add coverage for --require-virtualenv#13806

Open
LouisLau-art wants to merge 1 commit intopypa:mainfrom
LouisLau-art:test/require-virtualenv-12843
Open

tests: add coverage for --require-virtualenv#13806
LouisLau-art wants to merge 1 commit intopypa:mainfrom
LouisLau-art:test/require-virtualenv-12843

Conversation

@LouisLau-art
Copy link

@LouisLau-art LouisLau-art commented Feb 13, 2026

Fixes #12843.

Adds unit tests covering:

  • --require-virtualenv exits with VIRTUALENV_NOT_FOUND when not running under a virtualenv.
  • Commands that opt out via ignore_require_venv = True (e.g. pip help) continue to work.
  • An explicit matrix test that enumerates pip commands and asserts whether each opts in/out of --require-virtualenv.

Tests:

  • python -m pytest tests/unit/test_base_command.py -q

@notatallshaw
Copy link
Member

While I appreciate testing PRs, especially unit tests, I don't think this fixes #12843 which notes that none of the functionality is tested, and this doesn't test any of the functionality. Would you agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for require-virtualenv

2 participants

Comments