Can't run the tests, but I can run the app in a browser

I have a Windows environment; I have created ‘mflix’ virtual environment in Anaconda and activated. I have the library attrs(19.3.0) in my env. My problem: I can’t run any tests from the test folder, like

pytest -m connection or
python test_db_connection.py

Here is an error when I try to run test_db_connection.py…
(mflix) C:\Users\E7470\Downloads\mflix-python\tests>python test_db_connection.py
Traceback (most recent call last):
File “test_db_connection.py”, line 10, in
import pytest
File “C:\Program Files\Anaconda3\lib\site-packages\pytest.py”, line 13, in
from _pytest.fixtures import fixture, yield_fixture
File “C:\Program Files\Anaconda3\lib\site-packages_pytest\fixtures.py”, line 839, in
class FixtureFunctionMarker(object):
File “C:\Program Files\Anaconda3\lib\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’

Here is the error when I try to run pytest -m connection …
(mflix) C:\Users\E7470\Downloads\mflix-python\tests>pytest -m connection
Traceback (most recent call last):
File “c:\program files\anaconda3\lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “c:\program files\anaconda3\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Program Files\Anaconda3\Scripts\pytest.exe_main
.py", line 5, in
File “c:\program files\anaconda3\lib\site-packages\pytest.py”, line 13, in
from _pytest.fixtures import fixture, yield_fixture
File “c:\program files\anaconda3\lib\site-packages_pytest\fixtures.py”, line 839, in
class FixtureFunctionMarker(object):
File “c:\program files\anaconda3\lib\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’

Suggest searching the forum:

1 Like

Thanks again 007_jb!!! The VERSION of library attrs was the issue> Only the OLDER version works.

1 Like

:cowboy_hat_face: :+1:

1 Like