diff --git a/testing/conftest.py b/testing/conftest.py
index <HASH>..<HASH> 100644
--- a/testing/conftest.py
+++ b/testing/conftest.py
@@ -24,8 +24,8 @@ def restore_settrace():
 
     newtrace = sys.gettrace()
     if newtrace is not _orig_trace:
-        assert newtrace is None
         sys.settrace(_orig_trace)
+        assert newtrace is None
 
 
 @pytest.fixture
tests: restore_settrace: restore before failing (#<I>)