From 6fe8f9de360de92d37af5f383a39ca5bbb9302e9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 9 Jun 2020 18:46:14 +0200 Subject: [PATCH] bpo-40927: Fix test_binhex when run twice test_binhex now uses import_fresh_module() to ensure that it raises DeprecationWarning each time. --- Lib/test/test_binhex.py | 2 +- Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst diff --git a/Lib/test/test_binhex.py b/Lib/test/test_binhex.py index 86ca37ce1b99a7..859553222a3e90 100644 --- a/Lib/test/test_binhex.py +++ b/Lib/test/test_binhex.py @@ -7,7 +7,7 @@ from test import support with support.check_warnings(('', DeprecationWarning)): - import binhex + binhex = support.import_fresh_module('binhex') class BinHexTestCase(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst b/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst new file mode 100644 index 00000000000000..66209b84c94d69 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst @@ -0,0 +1,2 @@ +Fix test_binhex when run twice: it now uses import_fresh_module() to ensure +that it raises DeprecationWarning each time.