Skip to content
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

Provide an easy way to debug "behind the scenes" fixture creation with hooks #83

Closed
smarie opened this issue May 26, 2020 · 0 comments · Fixed by #84
Closed

Provide an easy way to debug "behind the scenes" fixture creation with hooks #83

smarie opened this issue May 26, 2020 · 0 comments · Fixed by #84
Labels
enhancement New feature or request

Comments

@smarie
Copy link
Owner

smarie commented May 26, 2020

Many functions in the pytest_cases API create fixtures behind the scenes:

  • unpack_fixture
  • fixture_union
  • param_fixture[s]
  • parametrize_plus

This is because the design philosophy is not to mess with pytest internals when possible.

However, users may get lost when something unexpected happens. Besides all these fixture functions created behind the scenes can not be easily decorated: one cannot apply for example pytest-harvest's @saved_fixture decorator.

For all these reasons and to ease future maintenance/refactoring/debugging process, I propose to allow all the above functions to receive a hook argument, that will be called everytime a fixture is about to be created.

@smarie smarie added the enhancement New feature or request label May 26, 2020
smarie pushed a commit that referenced this issue May 26, 2020
…ures are created behind the scenes, so as to ease debugging and/or save fixtures (with `stored_fixture` from pytest harvest). Fixes #83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant