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)
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 @@
from test import support
with support.check_warnings(('', DeprecationWarning)):
- import binhex
+ binhex = support.import_fresh_module('binhex')
class BinHexTestCase(unittest.TestCase):