[Python-checkins] closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441)

Benjamin Peterson webhook-mailer at python.org
Tue Jan 30 01:14:21 EST 2018


https://github.com/python/cpython/commit/95441809ef77a8df5e14601ade6c054ef7114c02
commit: 95441809ef77a8df5e14601ade6c054ef7114c02
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2018-01-29T22:14:17-08:00
summary:

closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441)

files:
A Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst
M Lib/test/test_hashlib.py

diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 15fc22b02d77..751f74813d35 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -193,7 +193,7 @@ def test_get_builtin_constructor(self):
         try:
             import _md5
         except ImportError:
-            pass
+            self.skipTest("_md5 module not available")
         # This forces an ImportError for "import _md5" statements
         sys.modules['_md5'] = None
         # clear the cache
diff --git a/Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst b/Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst
new file mode 100644
index 000000000000..f4bf6aa1fc4a
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst
@@ -0,0 +1 @@
+Fix test_hashlib to not fail if the _md5 module is not built.



More information about the Python-checkins mailing list