Closed
Description
Detailed Description
PyTest will not install and is throwing an error when ran for tests, that is pytest
.
Pip Freeze
attrs==21.2.0
iniconfig==1.1.1
packaging==20.9
pluggy==0.13.1
py==1.10.0
pyparsing==2.4.7
pytest==6.2.4
toml==0.10.2
PyTest And OS Versions
pytest
is 6.2.4
, and the OS is Linux saif-kubuntu 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
, with python 3.8.5
.
Minimal working example
Running the code below will generate the error,
cd ~
mkdir pytest_bug_report && cd pytest_bug_report
virtualenv -m venv venv
source venv/bin/activate
pip install pytest
cat <<EOT >> test_sample.py
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
EOT
pytest
Or even simply,
cd ~
mkdir pytest_bug_report && cd pytest_bug_report
virtualenv -m venv venv
source venv/bin/activate
pip install pytest
pytest --version # this also generates the error for some reason
The error thrown is,
Traceback (most recent call last):
File "/home/saif/.local/bin/pytest", line 5, in <module>
from pytest import main
File "/home/saif/.local/lib/python3.8/site-packages/pytest.py", line 13, in <module>
from _pytest.fixtures import fixture, yield_fixture
File "/home/saif/.local/lib/python3.8/site-packages/_pytest/fixtures.py", line 839, in <module>
class FixtureFunctionMarker(object):
File "/home/saif/.local/lib/python3.8/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'
Yes, I've looked at similar issues, such as,
- TypeError: attrib() got an unexpected keyword argument 'convert'
- TypeError: attrib() got an unexpected keyword argument 'convert'
- TypeError: attrib() got an unexpected keyword argument 'converter'
The bottom line solution is to have the latest pytest
, and attrs
, I have both at 21.2.0
, and at 6.2.4
.