summaryrefslogtreecommitdiff
path: root/passlib/tests/test_utils_handlers.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-03-11 18:37:49 -0400
committerEli Collins <elic@assurancetechnologies.com>2012-03-11 18:37:49 -0400
commit09b88be2e515ebeddaf64a0f15309b6a3f04416f (patch)
tree9868ccb551c5dfd6e36d95e1b90c70ca440d6b14 /passlib/tests/test_utils_handlers.py
parent29468d26fa3c68a56bd739d4dd9be50d8dd6725c (diff)
downloadpasslib-09b88be2e515ebeddaf64a0f15309b6a3f04416f.tar.gz
added hack to clear warnings registry so assertWarningList() tests will pass reliably
Diffstat (limited to 'passlib/tests/test_utils_handlers.py')
-rw-r--r--passlib/tests/test_utils_handlers.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/passlib/tests/test_utils_handlers.py b/passlib/tests/test_utils_handlers.py
index 8ae5a96..9b28f3c 100644
--- a/passlib/tests/test_utils_handlers.py
+++ b/passlib/tests/test_utils_handlers.py
@@ -18,7 +18,7 @@ from passlib.utils import getrandstr, JYTHON, rng, to_unicode
from passlib.utils.compat import b, bytes, bascii_to_str, str_to_uascii, \
uascii_to_str, unicode, PY_MAX_25
import passlib.utils.handlers as uh
-from passlib.tests.utils import HandlerCase, TestCase, catch_warnings
+from passlib.tests.utils import HandlerCase, TestCase, catch_all_warnings
from passlib.utils.compat import u
#module
log = getLogger(__name__)
@@ -190,7 +190,7 @@ class SkeletonTest(TestCase):
self.assertIn(norm_salt(use_defaults=True), salts3)
# check explicit salts
- with catch_warnings(record=True) as wlog:
+ with catch_all_warnings(record=True) as wlog:
# check too-small salts
self.assertRaises(ValueError, norm_salt, salt='')
@@ -211,7 +211,7 @@ class SkeletonTest(TestCase):
self.consumeWarningList(wlog, PasslibHashWarning)
#check generated salts
- with catch_warnings(record=True) as wlog:
+ with catch_all_warnings(record=True) as wlog:
# check too-small salt size
self.assertRaises(ValueError, gen_salt, 0)
@@ -229,11 +229,11 @@ class SkeletonTest(TestCase):
self.consumeWarningList(wlog)
self.assertIn(gen_salt(5, relaxed=True), salts4)
- self.consumeWarningList(wlog, PasslibHashWarning)
+ self.consumeWarningList(wlog, ["salt too large"])
# test with max_salt_size=None
del d1.max_salt_size
- with catch_warnings(record=True) as wlog:
+ with catch_all_warnings(record=True) as wlog:
self.assertEqual(len(gen_salt(None)), 3)
self.assertEqual(len(gen_salt(5)), 5)
self.consumeWarningList(wlog)
@@ -259,7 +259,7 @@ class SkeletonTest(TestCase):
self.assertEqual(norm_rounds(use_defaults=True), 2)
# check explicit rounds
- with catch_warnings(record=True) as wlog:
+ with catch_all_warnings(record=True) as wlog:
# too small
self.assertRaises(ValueError, norm_rounds, rounds=0)
self.consumeWarningList(wlog)