From 6b2bbcc4cca414f35f67caa4674f59f41ff638ea Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 29 Jan 2018 23:01:32 -0800 Subject: [PATCH] closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441) (GH-5442) (cherry picked from commit 95441809ef77a8df5e14601ade6c054ef7114c02) Co-authored-by: Benjamin Peterson --- Lib/test/test_hashlib.py | 2 +- Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2018-01-29-21-30-44.bpo-32721.2Bebm1.rst diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 28613496d1..177143e01d 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -196,7 +196,7 @@ class HashLibTestCase(unittest.TestCase): 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 0000000000..f4bf6aa1fc --- /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. -- 2.50.1