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

Some tests are failing with Pytest 4 #275

Closed
okin opened this issue Dec 31, 2018 · 1 comment
Closed

Some tests are failing with Pytest 4 #275

okin opened this issue Dec 31, 2018 · 1 comment
Milestone

Comments

@okin
Copy link
Contributor

okin commented Dec 31, 2018

Calling fixtures directly is not supported with pytest 4.
Running the tests with pytest 4 leads to en error like the following:

request = <SubRequest 'pdep_manager' for <Function 'test_get_set[JsonDB]'>>

    @pytest.fixture(params=[JsonDB, DbmDB, SqliteDB])
    def pdep_manager(request):
>       return dep_manager(request)
E       _pytest.warning_types.RemovedInPytest4Warning: Fixture "dep_manager" called directly. Fixtures are not meant to be called directly, are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information.

tests/test_dependency.py:71: RemovedInPytest4Warning

In this case the tests have been run with pytest==4.0.2.

@schettino72 schettino72 added this to the 0.32 milestone Jan 2, 2019
@koobs
Copy link

koobs commented May 18, 2019

After backporting the fixes in 08e9c0b, I'm seeing the following fixture related error:

platform freebsd13 -- Python 3.6.8, pytest-4.5.0, py-1.8.0, pluggy-0.11.0 -- /usr/local/bin/python3.6
ERROR collecting tests/test_dependency.py
__________________________________________________________________
tests/test_dependency.py:72: in <module>
    pytest.fixture(params=[JsonDB, DbmDB, SqliteDB])(pdep_manager)
/usr/local/lib/python3.6/site-packages/_pytest/fixtures.py:986: in __call__
    "fixture is being applied more than once to the same function"
E   ValueError: fixture is being applied more than once to the same function

Related issues:

pytest-dev/pytest#3518
kevin1024/pytest-httpbin#49
pytest-dev/pytest#2334

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

No branches or pull requests

3 participants