-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Exception while using module scoped fixture (ok in 2.7.3 and broken in 2.8.x) #1100
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
Hi @skirpichev, thanks for the report! In case others want to take a stab at this, here's a reproducible example: conftest.py import pytest
@pytest.fixture(autouse=True, scope='module')
def check_disabled(request):
assert request.module is not None test_bug.py def test_foo():
"""
>>> 1 + 2
3
"""
pass Execute with:
|
BTW, this looks like a regression. Can you include fix in the next stable point release (of course, if the fix will be available)? |
I'll probably be the one releasing 2.8.2 at the beginning of next week - so if it's in until then, sure! |
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 @skirpichev, I just opened a PR which fixes this. Could you please confirm that it fixes your test suite?
|
On Sat, Oct 03, 2015 at 12:12:46PM -0700, Bruno Oliveira wrote:
Yep. Good logs from Travis: Thank you for fix. |
Now with my old conftest.py doesn't work. I see such tracebacks (looks similar to #943):
Removing module-scoped fixtures obviously "helps".
Build logs from Travis: good and bad.
The text was updated successfully, but these errors were encountered: