]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-108303: Move `double_const` to `test_import` where it belongs (GH-112108...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 Dec 2023 18:46:02 +0000 (19:46 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 18:46:02 +0000 (18:46 +0000)
gh-108303: Move `double_const` to `test_import` where it belongs (GH-112108)
(cherry picked from commit 0738b9a338fd27ff2d4456dd9c15801a8858ffd9)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Lib/test/test_import/__init__.py
Lib/test/test_import/data/double_const.py [moved from Lib/test/double_const.py with 100% similarity]

index 8632ac2e818fabed926bb2cace01c58401c2f460..f991f323573e1cbfa33fb0978a8114f10c3c90be 100644 (file)
@@ -135,9 +135,12 @@ class ImportTests(unittest.TestCase):
             import RAnDoM
 
     def test_double_const(self):
-        # Another brief digression to test the accuracy of manifest float
-        # constants.
-        from test import double_const  # don't blink -- that *was* the test
+        # Importing double_const checks that float constants
+        # serialiazed by marshal as PYC files don't lose precision
+        # (SF bug 422177).
+        from test.test_import.data import double_const
+        unload('test.test_import.data.double_const')
+        from test.test_import.data import double_const
 
     def test_import(self):
         def test_with_extension(ext):