@borutzki TIL about nullcontext, and no longer have to split tests between pass/fail scenarios
@studiop but remember that with great power comes great responsibility ;)
@borutzki Cool! Can you test the result though, e.g. assert x/y == pytest.approx(blah)?
@blair @borutzki Yes, something like this:
@hugovk @blair exactly, nothing stops you from doing the standard assertion.
@borutzki Thanks, this is great. I tweaked it in a blog post: https://nedbatchelder.com/blog/202601/testing_exceptions_and_caches
Testing: exceptions and caches

Nicer ways to test exceptions and to test cached function results.

@nedbat nice! I'm glad to be useful! ;)