I am using Jupyter Notebook or Jupyter Lab for teaching the basics of Python.
Is it possible to run tests on previous cell's standard output without suppressing the output of a cell?
Magics %%capture with standard config redirects stdout. I'd like to be able to still see the output of the cell before running the tests.
e.g.
[cell 1] >> print('Hello, world!')
Hello, world!
Testing cell:
[cell 2] >> if (cell1.stdout == 'Hello, world!'):
... print('Success!')
... else:
... print('Tests failed')