You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running pytest in the root directory successfully runs test_dummy. But when ptw is run in the root directory, it complains of an ImportError as Python can't find title_api module.
pytest-watch should work similarly to pytest here (add the parent directory to sys.path before running tests).
Notes:
I install latest commit of pytest-watch from its Github url.
I am running version 7.2.0 of pytest in Python 3.11.
My OS is Windows 11.
The text was updated successfully, but these errors were encountered:
It seems to be resolved by adding an __init__.py file to your tests folder.
I haven't dug in to explore why it occurs. Adding an (empty) __init__.py to your tests folder can have other impacts, mostly around static analysis, but is generally pretty safe / minor.
I have a folder structure like this:
Content of
test_title_api.py
is:Running
pytest
in theroot
directory successfully runstest_dummy
. But whenptw
is run in theroot
directory, it complains of anImportError
as Python can't findtitle_api
module.pytest-watch
should work similarly topytest
here (add the parent directory tosys.path
before running tests).Notes:
pytest-watch
from its Github url.7.2.0
ofpytest
in Python 3.11.The text was updated successfully, but these errors were encountered: