Status: Valid
Owner: ----
Labels: Type-Defect Priority-Critical Testing

New issue 3272 by asmeu...@gmail.com: Python 3.3 test failures
http://code.google.com/p/sympy/issues/detail?id=3272

There are many test failures in Python 3.3. It's still in alpha stage, so you have to download it from python.org (see http://python.org/download/releases/3.3.0/). Unfortunately, there are binaries only for Mac OS X and Windows, so on Linux you'll have to compile it (but don't worry, it's straight forward to compile, and doesn't take long).

Here is a preliminary of some of the test failures. It isn't all of them because the test hang, and the doctests crash.

________________________________________________________ sympy/core/tests/test_arit.py:test_float_int ________________________________________________________ File "/users/aaronmeurer/documents/python/sympy/sympy/py3k-sympy/sympy/core/tests/test_arit.py", line 1380, in test_float_int
    assert int(Float('1.123456789012345678901234567890e20','')) == \
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/numbers.py", line 543, in __new__
    num, dps = _decimal_to_Rational_prec(Num)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/numbers.py", line 59, in _decimal_to_Rational_prec
    assert not dec._is_special
AttributeError: 'decimal.Decimal' object has no attribute '_is_special'

================ tests finished: 705 passed, 31 skipped, 28 expected to fail, 1 expected to fail but passed, 1 exceptions, in 1833.41 seconds ================
DO *NOT* COMMIT!
Traceback (most recent call last):
  File "py3k-sympy/bin/test", line 64, in <module>
    options.seed, "slow": options.slow, "timeout": options.timeout})
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 324, in test
    return t.test(sort=sort, timeout=timeout, slow=slow)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 648, in test
    self.test_file(f, sort, timeout, slow)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 727, in test_file
    f()
File "/users/aaronmeurer/documents/python/sympy/sympy/py3k-sympy/sympy/core/tests/test_expand.py", line 99, in test_issue_3022
    r, e = cse((eq).expand(complex=True))
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/simplify/cse_main.py", line 180, in cse
    reduced_exprs = [preprocess_for_cse(e, optimizations) for e in exprs]
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/simplify/cse_main.py", line 180, in <listcomp>
    reduced_exprs = [preprocess_for_cse(e, optimizations) for e in exprs]
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/simplify/cse_main.py", line 98, in preprocess_for_cse
    expr = pre(expr)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/simplify/cse_opts.py", line 21, in sub_pre
    if adds[a] else a) for a in adds])
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/basic.py", line 829, in subs
    if _aresame(so, sn):
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/basic.py", line 1526, in _aresame
    if i != j or type(i) != type(j):
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/numbers.py", line 2379, in __ne__
    return not self.__eq__(other)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/numbers.py", line 2368, in __eq__
    other = _sympify(other)
KeyboardInterrupt

The last traceback is because I had to interrupt in the hanging test in test_expand.py. I haven't tried running the remaining tests yet. For the doctests, we get:

sympy/concrete/products.py[4] .... [OK] sympy/concrete/summations.py[6] ...... [OK]
Traceback (most recent call last):
  File "py3k-sympy/bin/doctest", line 54, in <module>
    "blacklist": blacklist, "normal": options.normal})
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 410, in doctest
    failed = not t.test()
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 805, in test
    self.test_file(f)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/utilities/runtests.py", line 828, in test_file
    module = pdoctest._normalize_module(module)
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/doctest.py", line 205, in _normalize_module
    return __import__(module, globals(), locals(), ["*"])
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/__init__.py", line 8, in <module>
    from .expr import Expr, AtomicExpr
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/expr.py", line 2871, in <module>
    from .mul import Mul
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/mul.py", line 1527, in <module>
    from .numbers import Rational, igcd
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/numbers.py", line 2668, in <module>
    from .power import Pow, integer_nthroot
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/power.py", line 1015, in <module>
    from .symbol import Symbol, Dummy
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/symbol.py", line 8, in <module>
    from .function import FunctionClass
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load
  File "<frozen importlib._bootstrap>", line 634, in load_module
File "<frozen importlib._bootstrap>", line 294, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 522, in _load_module
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/py3k-sympy/sympy/core/function.py", line 85, in <module>
    class FunctionClass(ManagedProperties, metaclass=BasicMeta):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

and the test runner crashes at that point.

The likely reason for most of the test failures is that Python 3.3 enables hash randomization by default, which means that the hash of objects is now randomly determined when the interpreter starts up. Therefore, we need to run the tests in Python 3.3 multiple times to make sure that everything really works.

Also, we need to see if it's possible to print the random hash seed with the tests and input it manually, to aid fixing future failures caused by this.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to