I am attempting to setup a project on another laptop than my typical development machine. This project has several pytest-based tests that I have written over the lifetime of the project. When I run
$ pytest -k tests/my_test.py
I get a list of errors from sqlalchemy tests like the following:
_ ERROR collecting env/lib64/python3.5/site-packages/sqlalchemy/testing/suite/test_update_delete.py _
env/lib/python3.5/site-packages/py/_path/local.py:662: in pyimport
__import__(modname)
env/lib/python3.5/site-packages/sqlalchemy/testing/suite/__init__.py:2: in <module>
from sqlalchemy.testing.suite.test_cte import *
<frozen importlib._bootstrap>:968: in _find_and_load
???
<frozen importlib._bootstrap>:957: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:664: in _load_unlocked
???
<frozen importlib._bootstrap>:634: in _load_backward_compatible
???
env/lib/python3.5/site-packages/_pytest/assertion/rewrite.py:211: in load_module
py.builtin.exec_(co, mod.__dict__)
env/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_cte.py:11: in <module>
class CTETest(fixtures.TablesTest):
env/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_cte.py:99: in CTETest
@testing.requires.ctes_with_update_delete
E AttributeError: 'NoneType' object has no attribute 'ctes_with_update_delete'
Why is pytest collecting tests from a dependency? Is it supposed to do this? If not, how can I fix it?
The laptop where I am setting up this project is running Ubuntu 18.04. I created a virtualenv with Python 3.5.6 and ran pip install -r requirements
in the virtualenv without any errors, including sqlalchemy and pymssql.