-
Notifications
You must be signed in to change notification settings - Fork 5.2k
FEATURE: Builtin pytest magic #3456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe of interest: I wrote a small package |
@chmp You should be commended on a brilliant attempt at tackling this. This is the best option I see so far. In your README, you identify a few issues that are not obvious to most people and require attention, particularly with clearing the notebook globals when running tests. In the future, I hope there will be more dialog between the jupyter and pytest teams on making a idiomatic solution. Preferably, all the required boilerplate would be:
I am a bit hesitant to pepper additional magic throughout my notebooks to run tests. It is the only reason I still use |
@pylang Thanks a lot for the feedback. I understand your comment to have two parts:
Since I do not want to highjack the |
There has been some discussion at pytest-dev on adding some way to run pytest in notebooks.
One proposal has been to invoke a magic similar to
%matplotlib
at the start of the notebook. This would a override the normal assertion output for any cell with pytest's detailed output (see example here).Can we have a
%pytest
implemented as one of the builtin magics in jupyter notebooks?The text was updated successfully, but these errors were encountered: