-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Pytest fail when autouse fixture is applied and --doctest-modules is set #1057
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
Comments
The main problem was that previously DoctestModule was setting up its fixtures during collection, instead of letting each DoctestItem make its own fixture setup Fix pytest-dev#1100 Fix pytest-dev#1057
Hi @vitalk, I just opened a PR which fixes this. Could you please confirm that it fixes your test suite?
|
Works like a charm! Thank you. |
We're having this issue as well. Please to merge and release. |
@bukzor could you please test the PR branch as well? |
yep, it's fixed on that branch |
Thanks! 😄 |
Please to merge and release. |
Did this get released yet? |
No - it didn't make it into 2.8.2 and there's no 2.8.3 yet. But AFAIK @RonnyPfannschmidt plans to release 2.8.3 soon. |
Any progress on a 2.8.3 release? This issue is definitely still there. |
As we introduced an py.test autouse fixture, we cannot currently also run doctest-modules due to a bug in py.test (2.8.1, 2.8.2): pytest-dev/pytest#1057 Looks like a fix is planned for 2.8.3 release. Until then we have to disable doctests in modules.
…odules pytest-dev/pytest#1057 That means no more testpaths option. Leverage .gitignore instead. Manually exclude setup.py and tldextract_app folder.
…odules pytest-dev/pytest#1057 That means no more testpaths option. Leverage .gitignore instead. Manually exclude setup.py and tldextract_app folder.
When
--doctest-modules
option is set but module has no doctests available, then pytest raisesAssertionError
. This issue occurs only if autouse fixture is applied.$ py.test test_doctest_module.py --doctest-modules ================================== test session starts ================================== platform darwin -- Python 2.7.9, pytest-2.8.0, py-1.4.30, pluggy-0.3.1 rootdir: /Users/vital/.virtualenvs/tmp-83f75479bea7798, inifile: collected 2 items test_doctest_module.py ..
The text was updated successfully, but these errors were encountered: