-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
pytest_sessionstart
not run in custom test directories
#10987
Comments
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 11, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
Thanks for the reproducer, it was really helpful! Opened #10988 with a fix. |
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 11, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 11, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 11, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 11, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 12, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 12, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
May 12, 2023
The 'testpaths' option is meant to be identical to execute pytest passing the 'testpaths' directories explicitly. Fix pytest-dev#10987
jjbayer
added a commit
to getsentry/relay
that referenced
this issue
Jun 12, 2023
Our CI uses an unpinned version of `pytest`. pytest 7.3.2 includes the following fix: > [#10987](pytest-dev/pytest#10987): [testpaths](https://docs.pytest.org/en/latest/reference/reference.html#confval-testpaths) is now honored to load root conftests. ([changelog](https://docs.pytest.org/en/latest/changelog.html)) In our case, this led to an import error, because the CI job running tests in `py/` does not install the requirements needed to configure our python integration tests. Moving the pytest.ini file to `tests/` fixes the issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a custom test directory, other than
tests/
thepytest_sessionstart
hook (or the maybe also the entireconftest.py
) is not run. The issue appeared atpytest
version 7.3.1 under Windows 10.I created a minimum working example that shows the problem at https://github.com/padix-key/pytest-issue. When the tests folder
some_path
is renamed totests
pytest_sessionstart
()` is sucessfully run, indicated by the raised Exception. Otherwise it is not run.The text was updated successfully, but these errors were encountered: