Skip to content

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

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 28, 2025
config = pytester.parseconfig("--config-file", "custom.toml")
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.

@nicoddemus nicoddemus force-pushed the update-13480-changelog branch from 7bde507 to cdd40ed Compare July 26, 2025 01:06
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

LGTM

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
@nicoddemus nicoddemus force-pushed the update-13480-changelog branch from cdd40ed to 1315e7e Compare October 11, 2025 20:46
@nicoddemus nicoddemus enabled auto-merge (squash) October 11, 2025 20:46
@nicoddemus nicoddemus disabled auto-merge October 11, 2025 21:20
@nicoddemus nicoddemus merged commit 661682c into pytest-dev:main Oct 11, 2025
32 of 33 checks passed
@nicoddemus nicoddemus deleted the update-13480-changelog branch October 11, 2025 21:20
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

2 participants