summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-03 03:59:03 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-03 03:59:03 +0000
commitc71559cf19adad51a029aebfd663401cdb130aa6 (patch)
tree7ca5f2c635c5bb12de308f538d844392a71e1a43
parent9df5cf0fff6c7688bfced7b5fea46e486fe9c85d (diff)
downloadpsycopg2-c71559cf19adad51a029aebfd663401cdb130aa6.tar.gz
Don't convert into errors warnings raised where skip test is not available
-rw-r--r--tests/testutils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index 9347735..d63dc00 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -50,7 +50,9 @@ else:
@wraps(f)
def skipIf__(self):
if cond:
- warnings.warn(msg)
+ with warnings.catch_warnings():
+ warnings.simplefilter('always', UserWarning)
+ warnings.warn(msg)
return
else:
return f(self)
@@ -61,7 +63,9 @@ else:
return skipIf(True, msg)
def skipTest(self, msg):
- warnings.warn(msg)
+ with warnings.catch_warnings():
+ warnings.simplefilter('always', UserWarning)
+ warnings.warn(msg)
return
unittest.TestCase.skipTest = skipTest