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
In some of my notebooks, a given function call takes long time to return, making tests unpractical.
That is why I would like to be able to patch that function in the kernel with a mock.
I tried using the hooks provided by nbclient: on_notebook_start, etc. but they are not run in the kernel and therefore I cannot patch stuff there.
Is there some way of running code in the kernel prior to executing a notebook?
Alternatively: I see that testbook supports in-kernel patching. Since both testbook's TestbookNotebookClient and pytest_notebook's CoverageNotebookClient inherit from nbclient's NotebookClient, do you think that pytest-notebook could "borrow" the implementation from TestbookNotebookClient?
The text was updated successfully, but these errors were encountered:
In some of my notebooks, a given function call takes long time to return, making tests unpractical.
That is why I would like to be able to patch that function in the kernel with a mock.
I tried using the hooks provided by nbclient:
on_notebook_start
, etc. but they are not run in the kernel and therefore I cannot patch stuff there.Is there some way of running code in the kernel prior to executing a notebook?
Alternatively: I see that testbook supports in-kernel patching. Since both testbook's
TestbookNotebookClient
and pytest_notebook'sCoverageNotebookClient
inherit from nbclient'sNotebookClient
, do you think that pytest-notebook could "borrow" the implementation fromTestbookNotebookClient
?The text was updated successfully, but these errors were encountered: