How to fix pytest 5.2 execution returning TypeError: attrib() got an unexpected keyword argument 'convert'?

Viewed 415

My Ubuntu 18.04 setup.

$python --version
Python 3.7.4
$pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

$ pip show pytest attrs
Name: pytest
Version: 5.2.1
Summary: pytest: simple powerful testing with Python
Home-page: https://docs.pytest.org/en/latest/
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others
Author-email: None
License: MIT license
Location: /home/stoyan/.local/lib/python3.6/site-packages
Requires: atomicwrites, attrs, pluggy, more-itertools, wcwidth, py, importlib-metadata, packaging
---
Name: attrs
Version: 19.3.0
Summary: Classes Without Boilerplate
Home-page: https://www.attrs.org/
Author: Hynek Schlawack
Author-email: hs@ox.cx
License: MIT
Location: /home/stoyan/.local/lib/python3.6/site-packages
Requires: 

I explicitly state the versions of both pytest and attrs above, because my problem is similar to the one in this question, where the accepted answer was to update the versions, but that didn't work for me since my versions are more recent.

When I execute pytest --help I get the following output:

Traceback (most recent call last):
  File "/home/stoyan/anaconda3/bin/pytest", line 6, in <module>
    from pytest import main
  File "/home/stoyan/anaconda3/lib/python3.7/site-packages/pytest.py", line 13, in <module>
    from _pytest.fixtures import fixture, yield_fixture
  File "/home/stoyan/anaconda3/lib/python3.7/site-packages/_pytest/fixtures.py", line 839, in <module>
    class FixtureFunctionMarker(object):
  File "/home/stoyan/anaconda3/lib/python3.7/site-packages/_pytest/fixtures.py", line 841, in FixtureFunctionMarker
    params = attr.ib(convert=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'convert'
0 Answers
Related