summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep247.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-03-03 19:15:45 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-03-03 19:15:45 (GMT)
commit180510d29b369b88b0eb8815086162d2d6ef60a7 (patch)
tree601f7bbe919055da1871f14c9576f0199507bd72 /Lib/test/test_pep247.py
parente7a30f7216f6cb6733ed6aa450467b487b07cf9b (diff)
downloadcpython-180510d29b369b88b0eb8815086162d2d6ef60a7.zip
cpython-180510d29b369b88b0eb8815086162d2d6ef60a7.tar.gz
cpython-180510d29b369b88b0eb8815086162d2d6ef60a7.tar.bz2
Merged revisions 61189-61190,61192,61194-61195,61198-61199 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61189 | brett.cannon | 2008-03-03 01:38:58 +0100 (Mon, 03 Mar 2008) | 5 lines Refactor test_logging to use unittest. This should finally solve the flakiness issues. Thanks to Antoine Pitrou for the patch. ........ r61190 | jeffrey.yasskin | 2008-03-03 02:27:03 +0100 (Mon, 03 Mar 2008) | 3 lines compile.c always emits END_FINALLY after WITH_CLEANUP, so predict that in ceval.c. This is worth about a .03-.04us speedup on a simple with block. ........ r61192 | brett.cannon | 2008-03-03 03:41:40 +0100 (Mon, 03 Mar 2008) | 4 lines Move test_largefile over to using 'with' statements for open files. Also rename the driver function to test_main() instead of main_test(). ........ r61194 | brett.cannon | 2008-03-03 04:24:48 +0100 (Mon, 03 Mar 2008) | 3 lines Add a note in the main test class' docstring that the order of execution of the tests is important. ........ r61195 | brett.cannon | 2008-03-03 04:26:43 +0100 (Mon, 03 Mar 2008) | 3 lines Add a note in the main test class' docstring that the order of execution of the tests is important. ........ r61198 | brett.cannon | 2008-03-03 05:19:29 +0100 (Mon, 03 Mar 2008) | 4 lines Add test_main() functions to various tests where it was simple to do. Done so that regrtest can execute the test_main() directly instead of relying on import side-effects. ........ r61199 | neal.norwitz | 2008-03-03 05:37:45 +0100 (Mon, 03 Mar 2008) | 1 line Only DECREF if ret != NULL ........
Diffstat (limited to 'Lib/test/test_pep247.py')
-rw-r--r--Lib/test/test_pep247.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_pep247.py b/Lib/test/test_pep247.py
index 89ca6ff..2a2d7ac 100644
--- a/Lib/test/test_pep247.py
+++ b/Lib/test/test_pep247.py
@@ -5,6 +5,9 @@
import hmac
+import hmac
+from test.test_support import verbose
+
def check_hash_module(module, key=None):
assert hasattr(module, 'digest_size'), "Must have digest_size"
assert (module.digest_size is None or
@@ -41,8 +44,13 @@ def check_hash_module(module, key=None):
hd2 += "%02x" % 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(hmac, key=b'abc')
+
+
+if __name__ == '__main__':
+ test_main()