Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Feb 3, 2021

Fixes #658

  • 1st commit : Applies monkey patch globally to all tests, removes test packages from pyproject.toml

  • 2nd commit : Scopes it to only relevant packages, so unrelated tests don't have sys.path's altered.

    This is optional, but good to ensure explicitness (down the road, implicit alteration of site packages for all tests may be super hard to track down if it leads to an error in tests years from now, so I try to use autouse=True sparingly as possible)

Any thoughts on this approach @joseph-flinn?

@tony tony requested a review from joseph-flinn February 3, 2021 13:25
Copy link
Contributor

@joseph-flinn joseph-flinn left a comment

Choose a reason for hiding this comment

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

@tony I like this approach much better than what I had. Testing is probably my weakest technical skill and monkeypatch is still a pretty big black box to me.

@tony
Copy link
Member Author

tony commented Feb 3, 2021

@joseph-flinn Then let's give this a shot! I will backport and publish versions for 1.6 and 1.7 to see if that works for #658 (and any other maintainers that bumped into this issue)

@tony tony merged commit 8050d11 into master Feb 3, 2021
tony added a commit that referenced this pull request Feb 3, 2021
@tony tony deleted the pytest-site-paths branch June 11, 2022 20:52
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.

1.7.0: running pytest only possible with poetry or using PYTHONPATH

3 participants