[Python-checkins] r61195 - python/trunk/Lib/test/test_pep247.py
brett.cannon
python-checkins at python.org
Mon Mar 3 04:26:43 CET 2008
Author: brett.cannon
Date: Mon Mar 3 04:26:43 2008
New Revision: 61195
Modified:
python/trunk/Lib/test/test_pep247.py
Log:
Add a note in the main test class' docstring that the order of execution of the
tests is important.
Modified: python/trunk/Lib/test/test_pep247.py
==============================================================================
--- python/trunk/Lib/test/test_pep247.py (original)
+++ python/trunk/Lib/test/test_pep247.py Mon Mar 3 04:26:43 2008
@@ -10,6 +10,8 @@
DeprecationWarning)
import md5, sha, hmac
+from test.test_support import verbose
+
def check_hash_module(module, key=None):
assert hasattr(module, 'digest_size'), "Must have digest_size"
@@ -47,10 +49,15 @@
hd2 += "%02x" % ord(byte)
assert hd2 == hexdigest, "hexdigest doesn't appear correct"
- print 'Module', module.__name__, 'seems to comply with PEP 247'
+ if verbose:
+ print 'Module', module.__name__, 'seems to comply with PEP 247'
-if __name__ == '__main__':
+def test_main():
check_hash_module(md5)
check_hash_module(sha)
check_hash_module(hmac, key='abc')
+
+
+if __name__ == '__main__':
+ test_main()
More information about the Python-checkins
mailing list