diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 28613496d111b03..177143e01dc78f8 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -196,7 +196,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 000000000000000..f4bf6aa1fc4afa4 --- /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.