mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
gh-108303: Move all math files to Lib/test/mathdata/
(#109512)
This commit is contained in:
parent
11636788da
commit
ed587be0d0
8 changed files with 6 additions and 4 deletions
|
@ -25,7 +25,7 @@ NAN = float("nan")
|
||||||
|
|
||||||
#locate file with float format test values
|
#locate file with float format test values
|
||||||
test_dir = os.path.dirname(__file__) or os.curdir
|
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):
|
class FloatSubclass(float):
|
||||||
pass
|
pass
|
||||||
|
@ -768,6 +768,7 @@ class FormatTestCase(unittest.TestCase):
|
||||||
class ReprTestCase(unittest.TestCase):
|
class ReprTestCase(unittest.TestCase):
|
||||||
def test_repr(self):
|
def test_repr(self):
|
||||||
with open(os.path.join(os.path.split(__file__)[0],
|
with open(os.path.join(os.path.split(__file__)[0],
|
||||||
|
'mathdata',
|
||||||
'floating_points.txt'), encoding="utf-8") as floats_file:
|
'floating_points.txt'), encoding="utf-8") as floats_file:
|
||||||
for line in floats_file:
|
for line in floats_file:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
|
@ -33,8 +33,8 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
file = __file__
|
file = __file__
|
||||||
test_dir = os.path.dirname(file) or os.curdir
|
test_dir = os.path.dirname(file) or os.curdir
|
||||||
math_testcases = os.path.join(test_dir, 'math_testcases.txt')
|
math_testcases = os.path.join(test_dir, 'mathdata', 'math_testcases.txt')
|
||||||
test_file = os.path.join(test_dir, 'cmath_testcases.txt')
|
test_file = os.path.join(test_dir, 'mathdata', 'cmath_testcases.txt')
|
||||||
|
|
||||||
|
|
||||||
def to_ulps(x):
|
def to_ulps(x):
|
||||||
|
@ -2559,7 +2559,7 @@ class IsCloseTests(unittest.TestCase):
|
||||||
|
|
||||||
def load_tests(loader, tests, pattern):
|
def load_tests(loader, tests, pattern):
|
||||||
from doctest import DocFileSuite
|
from doctest import DocFileSuite
|
||||||
tests.addTest(DocFileSuite("ieee754.txt"))
|
tests.addTest(DocFileSuite(os.path.join("mathdata", "ieee754.txt")))
|
||||||
return tests
|
return tests
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -2157,6 +2157,7 @@ TESTSUBDIRS= idlelib/idle_test \
|
||||||
test/encoded_modules \
|
test/encoded_modules \
|
||||||
test/leakers \
|
test/leakers \
|
||||||
test/libregrtest \
|
test/libregrtest \
|
||||||
|
test/mathdata \
|
||||||
test/subprocessdata \
|
test/subprocessdata \
|
||||||
test/support \
|
test/support \
|
||||||
test/support/_hypothesis_stubs \
|
test/support/_hypothesis_stubs \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue