From af6932575391bca10f4f2145b56e3edbe9765343 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 10 Jun 2020 20:17:13 +0200 Subject: bpo-40927: Fix test_binhex when run twice (GH-20764) (GH-20789) test_binhex now uses import_fresh_module() to ensure that it raises DeprecationWarning each time. (cherry picked from commit 9c24e2e4c10705d95258558348417a28007dac66) --- 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 86ca37c..8595532 100644 --- a/Lib/test/test_binhex.py +++ b/Lib/test/test_binhex.py @@ -7,7 +7,7 @@ import unittest 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 0000000..66209b8 --- /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. -- cgit v0.12