Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run tests with pytest anymore #29

Closed
andreagrandi opened this issue Mar 28, 2020 · 0 comments · Fixed by #30
Closed

Cannot run tests with pytest anymore #29

andreagrandi opened this issue Mar 28, 2020 · 0 comments · Fixed by #30
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@andreagrandi
Copy link
Owner

Hi everyone,

I was going to work on CircleCI (and this is a confirmation that I probably should have done it sooner) integration, and before doing that I wanted to make sure that pytest was still running correctly, but despite having installed all the required libraries in my virtual environment, I'm getting this error:

(covid-api) ➜  covid-api git:(master) ✗ pytest
============================================================================================================================= test session starts ==============================================================================================================================
platform darwin -- Python 3.8.1, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /Users/andrea/Projects/covid-api
collected 0 items / 1 error

==================================================================================================================================== ERRORS ====================================================================================================================================
____________________________________________________________________________________________________________________ ERROR collecting tests/test_health.py _____________________________________________________________________________________________________________________
ImportError while importing test module '/Users/andrea/Projects/covid-api/tests/test_health.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_health.py:1: in <module>
    from fastapi.testclient import TestClient
E   ModuleNotFoundError: No module named 'fastapi.testclient'

I've also tried to open a Python shell and import it manually, but I'm getting the same error:

(covid-api) ➜  covid-api git:(master) ✗ python
Python 3.8.1 (default, Feb  6 2020, 15:57:25)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fastapi.testclient import TestClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'fastapi.testclient'

Does anyone know how/when this was broken? Am I doing something wrong?

cc @MatMoore

Cheers

@andreagrandi andreagrandi added bug Something isn't working help wanted Extra attention is needed labels Mar 28, 2020
andreagrandi added a commit that referenced this issue Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant