Skip to content
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

Consider testpaths for initial conftests #10988

Merged
merged 4 commits into from
May 12, 2023

Conversation

nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented May 11, 2023

The testpaths option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly.

This also fixes #10169, given I had to change the same part of the code in order to get tests to pass on Python 3.7.

Fix #430
Fix #10169
Fix #10987

@RonnyPfannschmidt
Copy link
Member

@nicoddemus does this also close #430 ?

@nicoddemus
Copy link
Member Author

@nicoddemus does this also close #430 ?

IIUC, yes because testpaths now makes the conftest.py files at that location "initial".

@nicoddemus nicoddemus force-pushed the initial-testpaths-10987 branch 2 times, most recently from 129b365 to 49d99f0 Compare May 12, 2023 11:55
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

Lovely

The 'testpaths' option is meant to be identical to execute
pytest passing the 'testpaths' directories explicitly.

Fix pytest-dev#10987
`_set_initial_conftests` could break on some systems if a very long
option was passed, because the `Path.exists()` call raises an
`OSError` instead of returning `False`.

Fix pytest-dev#10169
@nicoddemus
Copy link
Member Author

Re-requesting review given I added a new commit also fixing #10169.

@nicoddemus nicoddemus merged commit 76d1523 into pytest-dev:main May 12, 2023
25 checks passed
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request May 12, 2023
…-10987

 Consider testpaths for initial conftests

(cherry picked from commit 76d1523)
nicoddemus added a commit that referenced this pull request May 12, 2023
…0995)

Consider testpaths for initial conftests

(cherry picked from commit 76d1523)
nocarryr added a commit to nocarryr/python-dispatch that referenced this pull request Jun 22, 2023
Issue related to `testpaths` option and nested conftest modules
causes ImportErrors in the sphinx plugin tests.
Needs further investigation, but just pin it for now

Related changes:
pytest-dev/pytest#10988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants