Skip to content

Conversation

@YannickJadoul
Copy link
Contributor

@YannickJadoul YannickJadoul commented Jan 3, 2019

This PR should allow for more complex combinations of lazy fixtures:

  • On the one hand, if a test/fixture is parametrized with one or more lazy_fixtures that require other parametrized fixtures themselves, this would now result in an error (see test test_lazy_fixtures_with_subfixtures)
    This should also fix issue Nested fixtures are not seen by pytest_lazyfixture unless autouse=True #23, as demonstrated in the added test test_issues23.
  • On the other hand, fixtures requiring subfixures with parametrized with lazy_fixtures would not have these lazy fixtures resolved (resulting in type errors; see test test_lazy_fixtures_in_subfixture).
    This is similar to PR Add support for nested lazy_fixtures calls #28, except that it resolves nested lazy_fixtures in the parameters instead of as return values (as I am assuming is the aim of this project?).

EDIT:
Oh, yes, the first commit of this PR also fixes a few existing tests, after direct application of marks inside parametrize values were deprecated/removed.

@TvoroG
Copy link
Owner

TvoroG commented Jan 4, 2019

@YannickJadoul, thanks a lot! It looks really good. I will definitely merge this PR but I need a little bit of time to get familiar with the new code and understand how it solves the limitations.

@YannickJadoul
Copy link
Contributor Author

YannickJadoul commented Jan 4, 2019

@TvoroG Great! Thank you :-)
Thanks as well for making this library in the first place, by the way.

If you have any questions, do let me know.

I can give a quick, intuitive summary of the changes if that helps:

I am now also thinking that I will make the last commit into a different PR, since it has a different purpose. This should make it easier to review, as well :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants