I checked this with pytest 3.4.1 and master (3.4.2.dev42+ge980fbbe):
$PYTHONWARNINGS="error::DeprecationWarning,default::DeprecationWarning:_pytest.assertion.rewrite" python -m pytest
/Users/davidchudzicki/.virtualenvs/pytest_convert_repro/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/davidchudzicki/.virtualenvs/pytest_convert_repro/lib/python3.6/site-packages/pytest.py", line 13, in <module>
from _pytest.fixtures import fixture, yield_fixture
File "/Users/davidchudzicki/.virtualenvs/pytest_convert_repro/lib/python3.6/site-packages/_pytest/fixtures.py", line 840, in <module>
class FixtureFunctionMarker(object):
File "/Users/davidchudzicki/.virtualenvs/pytest_convert_repro/lib/python3.6/site-packages/_pytest/fixtures.py", line 842, in FixtureFunctionMarker
params = attr.ib(convert=attr.converters.optional(tuple))
File "/Users/davidchudzicki/.virtualenvs/pytest_convert_repro/lib/python3.6/site-packages/attr/_make.py", line 153, in attrib
DeprecationWarning, stacklevel=2
DeprecationWarning: The `convert` argument is deprecated in favor of `converter`. It will be removed after 2019/01.
(That second bit of PYTHONWARNINGS is to avoid https://github.com/pytest-dev/pytest/issues/1403.)
This is in a fresh virtualenv after pip install pytest:
$pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
attrs (17.4.0)
more-itertools (4.1.0)
pip (9.0.1)
pluggy (0.6.0)
py (1.5.2)
pytest (3.4.1)
setuptools (38.5.1)
six (1.11.0)
wheel (0.30.0)
$python --version
Python 3.6.4
$sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.4
BuildVersion: 16E195
For context on why I care: I contribute to another project that's turning on "deprecation warnings as errors" in our CI. It's not so hard for us to special-case ignore this warning, but I thought I should mention it here.
thanks for the note, this has been fixed in #3228 and will be released in the next feature release
we cant fix it in the patch release due to the shift in dependencies needed to correctly do this change in a minimal fashion
Thanks @RonnyPfannschmidt!
@RonnyPfannschmidt - any idea when the next feature release will be? If it's a long way off, I have a four-line shim that would fix this without a dependency bump.
@Zac-HD https://github.com/pytest-dev/pytest/pull/3327 is open, so we should release in a few hours. 馃憤
seeing this issue pop-up now on pytest==4.1.1 on python:3.5.7
Update your pytest then!
Works perfectly on python==3.6.8 and pytest==5.2.0. Update the pytest version to solve the problem.
thanks @geraldoandradee @Zac-HD doing the upgrade anyhow,
yet i was curious as to why an old version would break at this point, are you also indicating i should not be surprised?
thanks @geraldoandradee @Zac-HD doing the upgrade anyhow,
yet i was curious as to why an old version would break at this point, are you also indicating i should not be surprised?
I was surprised, dude, believe me. This is the first time I ever saw this. But since this issue first happened in 2018, it seems to be an old issue. Kind of a bummer.
@rohansb It looks to me like attrs==19.2.0 caused this to break. I also experienced this (on an old project using pytest==4.0.1), and pinning attrs==19.1.0 fixed this error for me.
@leon-barrett I just ran into this same issue and pinning attrs==19.1.0 fixed it for me as well.
Most helpful comment
@rohansb It looks to me like
attrs==19.2.0caused this to break. I also experienced this (on an old project usingpytest==4.0.1), and pinningattrs==19.1.0fixed this error for me.