[pypy-commit] pypy default: workaround for issue #1259, use a module that has a correct __file__ attribute to compute the path to the math_testcases.txt file

bivab noreply at buildbot.pypy.org
Thu Oct 4 20:32:58 CEST 2012


Author: David Schneider <david.schneider at picle.org>
Branch: 
Changeset: r57783:17ffe013d44c
Date: 2012-10-04 15:32 -0300
http://bitbucket.org/pypy/pypy/changeset/17ffe013d44c/

Log:	workaround for issue #1259, use a module that has a correct __file__
	attribute to compute the path to the math_testcases.txt file

diff --git a/pypy/module/math/test/test_math.py b/pypy/module/math/test/test_math.py
--- a/pypy/module/math/test/test_math.py
+++ b/pypy/module/math/test/test_math.py
@@ -130,7 +130,7 @@
 
     def test_mtestfile(self):
         import math
-        import abc
+        import zipfile
         import os
         import struct
         def _parse_mtestfile(fname):
@@ -207,7 +207,7 @@
         fail_fmt = "{}:{}({!r}): expected {!r}, got {!r}"
 
         failures = []
-        math_testcases = os.path.join(os.path.dirname(abc.__file__), "test",
+        math_testcases = os.path.join(os.path.dirname(zipfile.__file__), "test",
                                       "math_testcases.txt")
         for id, fn, arg, expected, flags in _parse_mtestfile(math_testcases):
             func = getattr(math, fn)


More information about the pypy-commit mailing list