Skip to content

Fix autouse fixtures and doctest modules #1102

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

Merged

Conversation

nicoddemus
Copy link
Member

The problem was that DoctestModule was setting up fixtures before forwarding a getfixture function to the doc-tests; the correct approach is to actually let each DoctestItem configure its own fixtures during its setup phase.

Took the opportunity to add a lot of tests with all possible scopes to ensure all of them work properly.

Fix #1100
Fix #1057

Probably also fixes #943

@nicoddemus nicoddemus self-assigned this Oct 2, 2015
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
@nicoddemus nicoddemus force-pushed the doctest-fixtures-fix branch from 8e5536e to a14c77a Compare October 3, 2015 19:08
@nicoddemus nicoddemus changed the title [wip] Add failing test for ##1057 and #1100 Fix autouse fixtures and doctest modules Oct 3, 2015
@nicoddemus nicoddemus removed their assignment Oct 3, 2015
@RonnyPfannschmidt
Copy link
Member

from my pov this one is fine, but i'm not sure f it should be in master or in feature

@nicoddemus
Copy link
Member Author

I think on master... in 2.8 it was introduced autouse fixture support for doc-test modules, but the implementation was broken due to my misunderstanding on the proper time fixtures should be set-up (as the linked issues show).

@nicoddemus
Copy link
Member Author

Any chance of merging this for 2.8.2? 😁

@The-Compiler
Copy link
Member

I asked in IRC if someone wanted to review it yesterday and how important it was for 2.8.2, and nobody replied 😉

I can re-package (and to some degree test) 2.8.2 with it in tomorrow if it's in then, but I don't think I can review it properly, sorry.

@nicoddemus
Copy link
Member Author

No worries @The-Compiler! 😄

@The-Compiler
Copy link
Member

This didn't make it into 2.8.2, sorry - let's just do a 2.8.3 soon-ish instead of further delaying it 😉

RonnyPfannschmidt added a commit that referenced this pull request Oct 10, 2015
Fix autouse fixtures and doctest modules
@RonnyPfannschmidt RonnyPfannschmidt merged commit db07755 into pytest-dev:master Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants