diff --git a/setuptools/tests/contexts.py b/setuptools/tests/contexts.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/contexts.py
+++ b/setuptools/tests/contexts.py
@@ -83,3 +83,11 @@ def save_user_site_setting():
         yield saved
     finally:
         site.ENABLE_USER_SITE = saved
+
+
+@contextlib.contextmanager
+def suppress_exceptions(*excs):
+    try:
+        yield
+    except excs:
+        pass
diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_test.py
+++ b/setuptools/tests/test_test.py
@@ -91,9 +91,6 @@ class TestTestTest:
         cmd.install_dir = site.USER_SITE
         cmd.user = 1
         with contexts.quiet():
-            try:
+            # The test runner calls sys.exit
+            with contexts.suppress_exceptions(SystemExit):
                 cmd.run()
-            except SystemExit:
-                # The test runner calls sys.exit; suppress the exception
-                pass
-
Suppress exceptions in a context for clarity, brevity, and reuse.