aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/registry/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/tests/registry/util.py')
-rw-r--r--sources/pyside2/tests/registry/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside2/tests/registry/util.py b/sources/pyside2/tests/registry/util.py
index 5d0602b2a..d873a7d66 100644
--- a/sources/pyside2/tests/registry/util.py
+++ b/sources/pyside2/tests/registry/util.py
@@ -72,6 +72,12 @@ def isolate_warnings():
if warn is None:
delattr(mod, warn_name)
+@contextmanager
+def suppress_warnings():
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ yield
+
def check_warnings():
for name, mod in sys.modules.items():
if mod: