]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40927: Fix test_binhex when run twice (GH-20764)
authorVictor Stinner <vstinner@python.org>
Wed, 10 Jun 2020 17:54:29 +0000 (19:54 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2020 17:54:29 +0000 (19:54 +0200)
test_binhex now uses import_fresh_module() to ensure that it raises
DeprecationWarning each time.

Lib/test/test_binhex.py
Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst [new file with mode: 0644]

index 86ca37ce1b99a7a4be13f121700b714f23e99912..859553222a3e900679fb8bd3dbb7502fd29b521d 100644 (file)
@@ -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 (file)
index 0000000..66209b8
--- /dev/null
@@ -0,0 +1,2 @@
+Fix test_binhex when run twice: it now uses import_fresh_module() to ensure
+that it raises DeprecationWarning each time.