Add a pytest plugin to fix fixture handling #152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backwards compatible improvement to the way gabbi works
with pytest. Tests are loaded (and yielded in the same way) but
they are filtered more correctly, and fixture start and stops are
done more correctly.
This allows the test count to be accurate and test selection (using
-k) to work properly.
Fixes #128
Fixes #123
The details of this change are more clear with an understanding of
how pytest plugins and hooks work, but the gist is that a plugin has
been created and then forcibly installed. The plugin traverse the
collected tests to find and filter out the two tests associated with
each suite that start and stop fixtures. These are attached as
attributes to the first and last selected (if any) tests in the
relevant suite. When a test is asked to run:
will be run