chrisjsewell / pytest-notebook

A pytest plugin for regression testing and regenerating Jupyter Notebooks
https://pytest-notebook.readthedocs.io
BSD 3-Clause "New" or "Revised" License
49 stars 9 forks source link

Override PythonPath in a notebook run #85

Open yellowbean opened 3 months ago

yellowbean commented 3 months ago

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 ?