Building neo4j app with Python - Problem with pytest: Error loading create_app from api + solution

In chapter "Adding the driver" you are supposed to runt the first pytest, to test the functionality of the code.

There is an error when running command:

pytest tests/ described in the exercise. At least on my laptop running Mac OS X, Python 3.8.9. I get the following error:

ImportError while loading conftest './tests/'.
tests/ in <module>
    from api import create_app
E   ModuleNotFoundError: No module named 'api'

The reason for the error, and the solution to it, is explained here:

The solution to the problem is to run pytest from the following command:

python -m pytest tests/

Because this will make sure that class create_app from api/ is loaded when importing

Thanks for the heads up, I've merged a PR on the repo that adds an to the tests folder. Hopefully, no one else will run into this issue.