New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.7 test failures #15502

Closed
oscarbenjamin opened this Issue Nov 17, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@oscarbenjamin
Contributor

oscarbenjamin commented Nov 17, 2018

Running tests from master under Python 3.7.1 (which isn't tested on Travis) I see some failures. The fastest ones to see are from test_implicit_multiplication_application.py but there is another in test_sympify.py. I'm not sure what has changed in 3.7 to cause this.

$ ./bin/test sympy/parsing/tests/test_implicit_multiplication_application.py 
==================================================================== test process starts =====================================================================
executable:         /Users/enojb/current/sympy/upstream.sympy.git/venv371/bin/python  (3.7.1-final-0) [CPython]
architecture:       64-bit
cache:              yes
ground types:       python 
numpy:              None
random seed:        88174423
hash randomization: on (PYTHONHASHSEED=224844549)

sympy/parsing/tests/test_implicit_multiplication_application.py[5] .E..E                                                                                [FAIL]

______________________________________________________________________________________________________________________________________________________________
_________________________________ sympy/parsing/tests/test_implicit_multiplication_application.py:test_implicit_application __________________________________
Traceback (most recent call last):
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/cache.py", line 94, in wrapper
    retval = cfunc(*args, **kwargs)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/function.py", line 446, in __new__
    'given': n})
TypeError: factorial takes exactly 1 argument (0 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/tests/test_implicit_multiplication_application.py", line 62, in test_implicit_application
    implicit = parse_expr(case, transformations=transformations2)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/sympy_parser.py", line 965, in parse_expr
    return eval_expr(code, local_dict, global_dict)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/sympy_parser.py", line 878, in eval_expr
    code, global_dict, local_dict)  # take local objects in preference
  File "<string>", line 1, in <module>
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/cache.py", line 96, in wrapper
    retval = func(*args, **kwargs)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/function.py", line 446, in __new__
    'given': n})
TypeError: factorial takes exactly 1 argument (0 given)
______________________________________________________________________________________________________________________________________________________________
__________________________________ sympy/parsing/tests/test_implicit_multiplication_application.py:test_all_implicit_steps ___________________________________
Traceback (most recent call last):
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/cache.py", line 94, in wrapper
    retval = cfunc(*args, **kwargs)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/function.py", line 446, in __new__
    'given': n})
TypeError: factorial takes exactly 1 argument (0 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/tests/test_implicit_multiplication_application.py", line 183, in test_all_implicit_steps
    implicit = parse_expr(case, transformations=transformations2)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/sympy_parser.py", line 965, in parse_expr
    return eval_expr(code, local_dict, global_dict)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/parsing/sympy_parser.py", line 878, in eval_expr
    code, global_dict, local_dict)  # take local objects in preference
  File "<string>", line 1, in <module>
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/cache.py", line 96, in wrapper
    retval = func(*args, **kwargs)
  File "/Users/enojb/current/sympy/upstream.sympy.git/sympy/core/function.py", line 446, in __new__
    'given': n})
TypeError: factorial takes exactly 1 argument (0 given)

================================================== tests finished: 3 passed, 2 exceptions, in 0.26 seconds ===================================================
DO *NOT* COMMIT!

The error from test_sympify.py is

========================================================================== FAILURES ==========================================================================
___________________________________________________________________ test_sympify_keywords ____________________________________________________________________

    def test_sympify_keywords():
        raises(SympifyError, lambda: sympify('if'))
        raises(SympifyError, lambda: sympify('for'))
        raises(SympifyError, lambda: sympify('while'))
>       raises(SympifyError, lambda: sympify('lambda'))

sympy/core/tests/test_sympify.py:148: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sympy/core/tests/test_sympify.py:148: in <lambda>
    raises(SympifyError, lambda: sympify('lambda'))
sympy/core/sympify.py:372: in sympify
    expr = parse_expr(a, local_dict=locals, transformations=transformations, evaluate=evaluate)
sympy/parsing/sympy_parser.py:965: in parse_expr
    return eval_expr(code, local_dict, global_dict)
sympy/parsing/sympy_parser.py:878: in eval_expr
    code, global_dict, local_dict)  # take local objects in preference
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: __new__() missing 1 required positional argument: 'expr'

<string>:1: TypeError

asmeurer added a commit to asmeurer/sympy that referenced this issue Nov 21, 2018

Handle NEWLINE changes to the tokenize module
Python 3.6.7+/3.7.1+ always emits a NEWLINE token when there is no newline in
the input. The lambda_notation parser wasn't handling this properly.

This fixes a tests failures in master on 3.6.7+/3.7.1+.

Fixes sympy#15502.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment