Closed nakami closed 1 year ago
Update: I went with an obvious solution. It's possible to run pytest
directly in the directory of my jupyter notebook. This way, my relative paths are resolved relatively to this folder.
Anyways, instead I'd rather like to either manipulate the execution's working directory or be able to override variables during the execution. Executing pytest
from a different folder is working for me though, so I'll close this issue.
Hello, in my Jupyter Notebook I load data files via a pre-defined relative path. When I execute the Notebook in the normal fashion that path is valid. However, my Jupyter Notebook, my data set and my test file are in different directories. The
execute
parameter oftestbook
's decorator presumably executes the Notebook in the context of the current working directorypytest
is called from or in the context of the test file. Therefore, my relative path of the Notebook is no longer valid whentestbook
executes the Notebook before running my test.What would be considered good practice dealing with this problem?
Example of project structure:
Executing the
testbook
test: