Open
Conversation
Pytest 4 removed support for calling fixtures directly: https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly This leads to an error when trying to run the tests: ``` ==================================== ERRORS ==================================== _________________ ERROR collecting tests/test_bounding_box.py __________________ Fixture "red" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code. ```
Contributor
Author
|
The test failure looks irrelevant. |
Contributor
|
It seems to be caused by Ref: pypa/setuptools#1257 |
|
Thank you! Works for on openSUSE/Tumbleweed (and it is a part of the official package now). |
webknjaz
reviewed
Nov 19, 2019
Contributor
webknjaz
left a comment
There was a problem hiding this comment.
I think it's better to do this
|
|
||
|
|
||
| @pytest.fixture | ||
| def red(): |
Contributor
There was a problem hiding this comment.
Suggested change
| def red(): | |
| @pytest.fixture | |
| def red(): | |
| """Create an FST object for testing.""" | |
| return construct_fst() | |
| def construct_fst() | |
| """Return an FST object.""" |
| return red() | ||
|
|
||
|
|
||
| fst = red() |
Contributor
There was a problem hiding this comment.
Suggested change
| fst = red() | |
| fst = construct_fst() |
vibbix
pushed a commit
to kayak/redbaron
that referenced
this pull request
Mar 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pytest 4 removed support for calling fixtures directly: https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly
This leads to an error when trying to run the tests: