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
Hi,
I'm a fairly naive user of pytest, mostly in some educational context. While it's easy to use doctest & unittest tests within a notebook (see e.g. this gist or my own user case, it seems impossible to do the same with pytest tests, without resorting to plugins or additional dependencies (e.g. ipytest).
I definitely don't know all the gory internal details of pytest, but I wonder why it's not possible to easily embed pytest tests within a notebook, so that I can illustrate different (easier to write) test methods?
What's the problem this feature will solve?
Embed and run pytest tests within a jupyter notebook.
Describe the solution you'd like
A few-line self-consistent solution as possible with unittest, see e.g. this notebook.
Alternative Solutions
The ipytest solution works fine (with extra features), but requires an extra-dependency. I'm looking for a minimal procedure, mostly to illustrate the writing of pytest tests.
The text was updated successfully, but these errors were encountered:
Given that there is a project doing this already, and given how testing Jupyter notebooks is something rather exotic in the big picture... I really don't see why this would need to be part of the pytest core. What's the problem with an extra dependency, given that pytest (and Jupyter!) are already third-party packages anyways?
Point taken, I just wanted to be sure I did not overlook an easy way around. Regarding dependencies, adding new ones to a university system you're not controlling is not always an easy task. Jupyter and pytest are well identified, ipytest much less so...
Hi,
I'm a fairly naive user of pytest, mostly in some educational context. While it's easy to use doctest & unittest tests within a notebook (see e.g. this gist or my own user case, it seems impossible to do the same with pytest tests, without resorting to plugins or additional dependencies (e.g. ipytest).
I definitely don't know all the gory internal details of pytest, but I wonder why it's not possible to easily embed pytest tests within a notebook, so that I can illustrate different (easier to write) test methods?
What's the problem this feature will solve?
Embed and run pytest tests within a jupyter notebook.
Describe the solution you'd like
A few-line self-consistent solution as possible with unittest, see e.g. this notebook.
Alternative Solutions
The ipytest solution works fine (with extra features), but requires an extra-dependency. I'm looking for a minimal procedure, mostly to illustrate the writing of pytest tests.
The text was updated successfully, but these errors were encountered: