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

Proposal: Parametrize with fixtures #1660

Merged
merged 10 commits into from Jun 25, 2016

Conversation

@hackebrot
Copy link
Member

@hackebrot hackebrot commented Jun 25, 2016

Please see the Problem section of the added document.

@hpk42 and myself worked on this proposal in the course of the pytest-dev sprint.

@coveralls
Copy link

@coveralls coveralls commented Jun 25, 2016

Coverage Status

Coverage remained the same at 92.389% when pulling 5860c60 on hackebrot:parametrize-with-fixtures into f2bb3df on pytest-dev:features.

@The-Compiler
Copy link
Member

@The-Compiler The-Compiler commented Jun 25, 2016

I think stuff like that should be in a separate subfolder, like proposals or so?

@hackebrot
Copy link
Member Author

@hackebrot hackebrot commented Jun 25, 2016

@The-Compiler done. 👍

* This is very inconvenient if you wish to extend an existing test suite by
certain parameters for fixtures that are already used by tests

pytest version 3.0 and higher reports an error if you try to run above code::

This comment has been minimized.

@hpk42

hpk42 Jun 25, 2016
Contributor

just talk about pytest-3.0, not "higher"

@hackebrot
Copy link
Member Author

@hackebrot hackebrot commented Jun 25, 2016

I've added a new entry to the changelog. If you could please thumb this? @hpk42 @The-Compiler 🙇

@coveralls
Copy link

@coveralls coveralls commented Jun 25, 2016

Coverage Status

Coverage remained the same at 92.389% when pulling 1b6bc4d on hackebrot:parametrize-with-fixtures into f2bb3df on pytest-dev:features.

@The-Compiler The-Compiler merged commit 35cd12e into pytest-dev:features Jun 25, 2016
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Alternative approach
--------------------

A new helper function named ``fixture_request`` tells pytest to yield all

This comment has been minimized.

@nicoddemus

nicoddemus Jun 25, 2016
Member

@hackebrot after discussing in person with @hpk42, he convinced me the first approach beats this one. 😁

This comment has been minimized.

@hackebrot

hackebrot Jul 4, 2016
Author Member

@nicoddemus can you please comment here, what made you change your mind? 😄 (I am aware it's been a while already 😁 )

This comment has been minimized.

@nicoddemus

nicoddemus Jul 4, 2016
Member

I will try to remember then, but as you said it has been sometime already. 😁

This comment has been minimized.

@hackebrot

hackebrot Jul 4, 2016
Author Member

Right, let me help you remember. Next beer is on me. 🍻


.. code-block:: python
pytest.define_combined_fixture(

This comment has been minimized.

@fschulze

fschulze Jul 4, 2016
Contributor

If possible something like this would be more pythonic:

context = combined_fixture('default_context', 'extra_context')

This comment has been minimized.

@hackebrot

hackebrot Jul 4, 2016
Author Member

This will raise a flake8 error as it an unused variable.

More importantly @hpk42 and myself feel like the keyword arguments make this helper more verbose and comprehensible.

@hackebrot hackebrot deleted the hackebrot:parametrize-with-fixtures branch Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.