Skip to content

Handle --version eagerly to avoid loading the entire infrastructure #13575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicoddemus
Copy link
Member

Currently, handling --version in pytest_cmdline_main requires loading the entire infrastructure, which can be slow depending on the installed plugins.

This change introduces a marginal behavioral difference, though it should not cause any issues in practice.

Fixes #13574

Currently, handling `--version` in `pytest_cmdline_main` requires loading the entire infrastructure, which can be slow depending on the installed plugins.

This change introduces a marginal behavioral difference, though it should not cause any issues in practice.

Fixes pytest-dev#13574
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 28, 2025
@@ -612,20 +612,14 @@ def pytest_addoption(parser):
assert config.getini("custom") == "1"

def test_absolute_win32_path(self, pytester: Pytester) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

I tracked this test to this changelog entry:

* Fix win32 path issue when puttinging custom config file with absolute path 
  in ``pytest.main("-c your_absolute_path")``.

Seems --version being in the config file has nothing to do with the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest --version should not load all plugins
1 participant