Skip to content

Conversation

bluetech
Copy link
Member

The monkeypatch approach doesn't work for import pytest; pytest.TempdirFactory.

Fix #9432.

@bluetech bluetech added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Dec 25, 2021
@bluetech bluetech force-pushed the pytest-legacypath-imports branch from 6ac25c7 to bbc9b5b Compare December 25, 2021 11:11
The monkeypatch approach doesn't work for `import pytest;
pytest.TempdirFactory`.

Fix pytest-dev#9432.
@bluetech bluetech force-pushed the pytest-legacypath-imports branch from bbc9b5b to 3128080 Compare December 25, 2021 11:27
@bluetech
Copy link
Member Author

Adding the imports from _pytest.legacypath to pytest causes an import loop which necessitates all of the changes to the plugin to import from _pytest instead of pytest. This is unfortunate and will need to be undone when moving to a separate package but is required for now.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this!

@bluetech bluetech merged commit 69da199 into pytest-dev:main Dec 27, 2021
bluetech added a commit to bluetech/pytest that referenced this pull request Dec 27, 2021
…ports

pytest: bring back direct imports of TempdirFactory, Testdir
(cherry picked from commit 69da199)
@bluetech bluetech deleted the pytest-legacypath-imports branch December 27, 2021 15:03
@The-Compiler The-Compiler added backported and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Jan 3, 2022
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.

[prerelease] pytest.TmpdirFactory is not importable anymore
3 participants