]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108303: Move all math files to `Lib/test/mathdata/` (#109512)
authorNikita Sobolev <mail@sobolevn.me>
Thu, 21 Sep 2023 19:14:41 +0000 (22:14 +0300)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 19:14:41 +0000 (21:14 +0200)
Lib/test/mathdata/cmath_testcases.txt [moved from Lib/test/cmath_testcases.txt with 100% similarity]
Lib/test/mathdata/floating_points.txt [moved from Lib/test/floating_points.txt with 100% similarity]
Lib/test/mathdata/formatfloat_testcases.txt [moved from Lib/test/formatfloat_testcases.txt with 100% similarity]
Lib/test/mathdata/ieee754.txt [moved from Lib/test/ieee754.txt with 100% similarity]
Lib/test/mathdata/math_testcases.txt [moved from Lib/test/math_testcases.txt with 100% similarity]
Lib/test/test_float.py
Lib/test/test_math.py
Makefile.pre.in

index 84270ce7dd4780338e63f9f012620c1c994f7023..b6daae7e9280ffdc81ce50f19c94e9b1ccdcea43 100644 (file)
@@ -25,7 +25,7 @@ NAN = float("nan")
 
 #locate file with float format test values
 test_dir = os.path.dirname(__file__) or os.curdir
-format_testfile = os.path.join(test_dir, 'formatfloat_testcases.txt')
+format_testfile = os.path.join(test_dir, 'mathdata', 'formatfloat_testcases.txt')
 
 class FloatSubclass(float):
     pass
@@ -768,6 +768,7 @@ class FormatTestCase(unittest.TestCase):
 class ReprTestCase(unittest.TestCase):
     def test_repr(self):
         with open(os.path.join(os.path.split(__file__)[0],
+                  'mathdata',
                   'floating_points.txt'), encoding="utf-8") as floats_file:
             for line in floats_file:
                 line = line.strip()
index b71d08b1124497783499fc6a3e465ecd4c619df8..d5d2197c36b254defa7ee7117cfb6f2f055c9f54 100644 (file)
@@ -33,8 +33,8 @@ if __name__ == '__main__':
 else:
     file = __file__
 test_dir = os.path.dirname(file) or os.curdir
-math_testcases = os.path.join(test_dir, 'math_testcases.txt')
-test_file = os.path.join(test_dir, 'cmath_testcases.txt')
+math_testcases = os.path.join(test_dir, 'mathdata', 'math_testcases.txt')
+test_file = os.path.join(test_dir, 'mathdata', 'cmath_testcases.txt')
 
 
 def to_ulps(x):
@@ -2559,7 +2559,7 @@ class IsCloseTests(unittest.TestCase):
 
 def load_tests(loader, tests, pattern):
     from doctest import DocFileSuite
-    tests.addTest(DocFileSuite("ieee754.txt"))
+    tests.addTest(DocFileSuite(os.path.join("mathdata", "ieee754.txt")))
     return tests
 
 if __name__ == '__main__':
index 363be687d5a4320d3a714dd96bde2058f65ace2e..b6d00d5dc45007d8c5f84bc93e02c6f99ddba5aa 100644 (file)
@@ -2157,6 +2157,7 @@ TESTSUBDIRS=      idlelib/idle_test \
                test/encoded_modules \
                test/leakers \
                test/libregrtest \
+               test/mathdata \
                test/subprocessdata \
                test/support \
                test/support/_hypothesis_stubs \