pytest-notebook icon indicating copy to clipboard operation
pytest-notebook copied to clipboard

Override PythonPath in a notebook run

Open yellowbean opened this issue 1 year ago • 0 comments

Hi, Great work ! Thanks that's very helpful !

While I'm having an issue, the notebooks in project serves as examples. The notebooks are saved in folder docs/source/nbsample

mypackage/*
docs/source/nbsample

When running

pytest docs/source/nbsample --nb-force-regen  --import-mode=importlib

But it seems the code inside the notebook

import mypackage

are not able import local package mypackage.

Is there a way that to add PythonPath to the pytest-notebook which will force notebook to load local package ?

yellowbean avatar Jun 16 '24 05:06 yellowbean