Skip to content

Comments

Consider testpaths for initial conftests#10988

Merged
nicoddemus merged 4 commits intopytest-dev:mainfrom
nicoddemus:initial-testpaths-10987
May 12, 2023
Merged

Consider testpaths for initial conftests#10988
nicoddemus merged 4 commits intopytest-dev:mainfrom
nicoddemus:initial-testpaths-10987

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

@nicoddemus nicoddemus force-pushed the initial-testpaths-10987 branch 4 times, most recently from 9b30c5f to 2c38d8d Compare May 11, 2023 12:44
@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

Bruno Oliveira added 4 commits May 12, 2023 09:34
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 nicoddemus force-pushed the initial-testpaths-10987 branch from 19d3a6c to 4cc05e7 Compare May 12, 2023 12:34
@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
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