Skip to content

Commit

Permalink
pythongh-108303: Move all math files to Lib/test/mathdata/ (python#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored and Glyphack committed Jan 27, 2024
1 parent d26c9af commit 4ea0c4b
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion Lib/test/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#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
Expand Down Expand Up @@ -768,6 +768,7 @@ def test_issue35560(self):
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()
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
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):
Expand Down Expand Up @@ -2559,7 +2559,7 @@ def test_fractions(self):

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__':
Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 4ea0c4b

Please sign in to comment.