def restore_tracing():
        """Restore tracing function (when run with Coverage.py).

        https://bugs.python.org/issue37011
        """
        orig_trace = sys.gettrace()
        yield
        if sys.gettrace() != orig_trace:
            sys.settrace(orig_trace)
Restore tracing function (when run with Coverage.py).

        https://bugs.python.org/issue37011
        
testing/conftest.py