Doesn’t run for me (reported), and I don’t know how it can run for others as Config().nbs_path is indeed a string not a Path object so it doesn’t have a glob attribute?
Pete’s version is more than 1 year old, however just wrapping that in Path solves the issue. I’ve used it successfully in a project for some time now, here’s the file if you’re interested. It works very well, I was able to even include codecov in that project using Pete’s version, big shoutout to him.
Has anyone done mocking (unittest.mock) in Jupyter notebooks? I’m running into issues porting some code into nbdev.
There are some tests in the original codebase that leverage the @mock.patch and unittest.main(). They are simple enough to re-write without mocking. That would probably be a better approach anyways, but it got me wondering.
What is everyone’s experience so far with the use mocking in nbdev / Jupyter notebook? Haven’t seen much online.
P.S. let me know if it’d be better etiquette to start a separate post on this.
Hi. I don’t know of a way to do it with nbdev2, but @muellerzr did something that could be very useful here. Exporting the tests to a file or directory would allow you to use the regular pytest commands to compute the coverage.
I tried to port @muellerzr 's 01_export.ipynb to the latest nbdev and it seems that, the latest NBProcessor() doesn’t take preprocs= anymore as its param with the following @jeremy 's commit:
How should I fix without preprocs with the latest nbdev? Any hint? The error I got is: