Context Managers
mediumpy_functionalImplement three context managers (with @contextlib.contextmanager):
supresser(*types_)— suppress exceptions whose type is listed (the block exits normally); other exceptions propagate.retyper(type_from, type_to)— catchtype_fromand re-raise it astype_to, preserving the exception'sargs.dumper(stream=None)— on any exception, write its message tostream(defaultsys.stderr), then re-raise.
Your solution
Edit supresser and run the real pytest suite in your browser — no install required. Your code is saved locally.
Loading the Python runtime (first run only)…
Hints
Hint 1
Use @contextlib.contextmanager: put `yield` inside a try/except so the with-body runs at the yield.
Hint 2
supresser swallows listed types; retyper raises type_to(*e.args) from the caught error; dumper prints then re-raises.