I have a unit testing notebook, but I don’t like that I have to wrap each test with a function. Its a bunch of boiler plate that adds friction to testing, plus, it adds bloat to the implementation.
So I wrote a new way of discovering tests that looks for cells beginning with test_
, just like pytest. Then, if the cell throws an error, then its assumed to have failed. It looks for cells across the whole runtime, not just in the opened notebook, so there is no need to have a direct dependancy between the implementation and the tests.