Skip to content

pytest 3.6: ValueError: fixture is being applied more than once to the same function #49

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

Closed
hroncok opened this issue Jun 18, 2018 · 0 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Jun 18, 2018

$ tox -r -e py36
GLOB sdist-make: .../pytest-httpbin/setup.py
py36 recreate: .../pytest-httpbin/.tox/py36
py36 installdeps: pytest, requests
py36 inst: .../pytest-httpbin/.tox/dist/pytest-httpbin-0.3.0.zip
py36 installed: atomicwrites==1.1.5,attrs==18.1.0,blinker==1.4,brotlipy==0.7.0,certifi==2018.4.16,cffi==1.11.5,chardet==3.0.4,click==6.7,decorator==4.3.0,Flask==1.0.2,httpbin==0.7.0,idna==2.7,itsdangerous==0.24,Jinja2==2.10,MarkupSafe==1.0,more-itertools==4.2.0,pluggy==0.6.0,py==1.5.3,pycparser==2.18,pytest==3.6.1,pytest-httpbin==0.3.0,raven==6.9.0,requests==2.19.1,six==1.11.0,urllib3==1.23,Werkzeug==0.14.1
py36 runtests: PYTHONHASHSEED='1646700043'
py36 runtests: commands[0] | ./runtests.sh tests/
Traceback (most recent call last):
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/_pytest/config.py", line 355, in _getconftestmodules
    return self._path2confmods[path]
KeyError: local('.../pytest-httpbin/tests')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/_pytest/config.py", line 386, in _importconftest
    return self._conftestpath2mod[conftestpath]
KeyError: local('.../pytest-httpbin/tests/conftest.py')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/_pytest/config.py", line 392, in _importconftest
    mod = conftestpath.pyimport()
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/py/_path/local.py", line 668, in pyimport
    __import__(modname)
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 216, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File ".../pytest-httpbin/tests/conftest.py", line 6, in <module>
    pytest.fixture(autouse=True)(httpbin_ca_bundle)
  File ".../pytest-httpbin/.tox/py36/lib/python3.6/site-packages/_pytest/fixtures.py", line 900, in __call__
    "fixture is being applied more than once to the same function"
ValueError: fixture is being applied more than once to the same function
ERROR: could not load .../pytest-httpbin/tests/conftest.py

ERROR: InvocationError: '.../pytest-httpbin/runtests.sh tests/'
___________________________________ summary ____________________________________
ERROR:   py36: commands failed

See also pytest-dev/pytest#3518

hroncok added a commit to hroncok/pytest-httpbin that referenced this issue Jun 18, 2018
This is now required in pytest >= 3.6

See pytest-dev/pytest#3518

Fixes kevin1024#49
hroncok added a commit to hroncok/pytest-httpbin that referenced this issue Jun 18, 2018
This is now required in pytest >= 3.6

We define our own autoused fixtue not to change the API

See pytest-dev/pytest#3518

Fixes kevin1024#49
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

1 participant