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

Test failures with pytest 4 #5048

Closed
hroncok opened this issue Apr 8, 2019 · 1 comment · Fixed by #5049
Closed

Test failures with pytest 4 #5048

hroncok opened this issue Apr 8, 2019 · 1 comment · Fixed by #5049

Comments

@hroncok
Copy link
Contributor

hroncok commented Apr 8, 2019

The tests are failing with pytest 4. The reason is https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize

Run tox -re py37 to reproduce.

Expected Result

Tests collect and pass.

Actual Result

Tests fail to collect:

platform linux -- Python 3.7.3, pytest-4.4.0, py-1.8.0, pluggy-0.9.0
...
ERROR collecting tests/test_utils.py 
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/hooks.py:289: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:238: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:414: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/hooks.py:289: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:68: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:62: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:141: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:1006: in parametrize
    function_definition=self.definition,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/mark/structures.py:113: in _for_parametrize
    if len(param.values) != len(argnames):
E   TypeError: object of type 'MarkDecorator' has no len()

Reproduction Steps

$ tox -re py37

System Information

$ .tox/py37/bin/python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.8"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.7.3"
  },
  "platform": {
    "release": "5.0.5-300.fc30.x86_64",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.21.0"
  },
  "system_ssl": {
    "version": "1010102f"
  },
  "urllib3": {
    "version": "1.24.1"
  },
  "using_pyopenssl": false
}
@hroncok
Copy link
Contributor Author

hroncok commented Apr 8, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant