Skip to content

Test failures and warnings in master #23061

Closed
@asmeurer

Description

When I run the tests in master locally, I get several test failures.

_________________________________________________________ sympy/external/tests/test_pythonmpq.py:test_PythonMPQ _________________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/external/tests/test_pythonmpq.py", line 47, in test_PythonMPQ
    assert check_Q(Q(Decimal('0.6'))) == (3, 5)
TypeError: mpq() requires numeric or string argument
_________________________________________________________________________________________________________________________________________________________________________
____________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_RationalFunctionExpand ____________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 1634, in test_RationalFunctionExpand
    assert RationalFunctionExpand(x**S(5)*(e + f*x)**n/(a + b*x**S(3)), x) == -a*x**2*(e + f*x)**n/(b*(a + b*x**3)) +\
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 2174, in RationalFunctionExpand
    res = replace_all(UtilityOperator(expr, x), [rule1, rule2])
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/functions.py", line 256, in replace_all
    result = replacement(**subst)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 2155, in With2
    v = ExpandIntegrand(u, x)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 2217, in ExpandIntegrand
    res = replace_all(UtilityOperator(expr, x), ExpandIntegrand_rules, max_count = 1)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/functions.py", line 255, in replace_all
    subst = next(match(subexpr, pattern))
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 45, in match
    for subst in _match([subject], pattern.expression, Substitution(), local_constraints):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 129, in _match
    yield from match_iter
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 251, in _match_operation
    yield from _non_commutative_match(subjects, operation, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 231, in _non_commutative_match
    for new_subst in generator_chain(subst, *factories):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/utils.py", line 524, in generator_chain
    next_data = next(generators[generator_index])
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 153, in factory
    yield from _match(subjects, operand, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 129, in _match
    yield from match_iter
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 254, in _match_operation
    yield from _match_commutative_operation(subjects, parts, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 341, in _match_commutative_operation
    yield from _check_constraints(result, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 140, in _check_constraints
    if not constraint(substitution):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/expressions/constraints.py", line 190, in __call__
    return self.constraint(**args)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 6937, in cons_f26
    result_matchq = is_match(UtilityOperator(u, x), pat)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/functions.py", line 333, in is_match
    return any(True for _ in match(subject, pattern))
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/functions.py", line 333, in <genexpr>
    return any(True for _ in match(subject, pattern))
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 45, in match
    for subst in _match([subject], pattern.expression, Substitution(), local_constraints):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 129, in _match
    yield from match_iter
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 251, in _match_operation
    yield from _non_commutative_match(subjects, operation, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 231, in _non_commutative_match
    for new_subst in generator_chain(subst, *factories):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/utils.py", line 524, in generator_chain
    next_data = next(generators[generator_index])
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 153, in factory
    yield from _match(subjects, operand, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 129, in _match
    yield from match_iter
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 254, in _match_operation
    yield from _match_commutative_operation(subjects, parts, subst, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 341, in _match_commutative_operation
    yield from _check_constraints(result, constraints)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/matching/one_to_one.py", line 140, in _check_constraints
    if not constraint(substitution):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/matchpy/expressions/constraints.py", line 190, in __call__
    return self.constraint(**args)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 6934, in _cons_f_u
    return And(FreeQ(List(c, d), x), IntegerQ(p), Greater(p, m))
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 625, in Greater
    if args[i] <= args[i + 1]:
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/relational.py", line 511, in __bool__
    raise TypeError("cannot determine truth value of Relational")
TypeError: cannot determine truth value of Relational
_________________________________________________________________________________________________________________________________________________________________________
__________________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_Inequality __________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 1839, in test_Inequality
    assert not Inequality(S('0'), Less, m, LessEqual, S('1'))
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 5732, in Inequality
    r.append(f[i](e[i], e[i + 1]))
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/utility_function.py", line 616, in Less
    if args[i] >= args[i + 1]:
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/relational.py", line 511, in __bool__
    raise TypeError("cannot determine truth value of Relational")
TypeError: cannot determine truth value of Relational
_________________________________________________________________________________________________________________________________________________________________________
________________________________________ sympy/utilities/_compilation/tests/test_compilation.py:test_compile_link_import_strings ________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 516, in compile_link_import_py_ext
    mod = import_module_from_file(os.path.join(build_dir, extname), sources)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/util.py", line 248, in import_module_from_file
    raise ImportError("Failed to import: '%s'" % filename)
ImportError: Failed to import: '/var/folders/wc/dppcpmxs1tlb36nqcw853wkm0000gn/T/tmpxbcb2i91/_sigmoid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/shutil.py", line 815, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/wc/dppcpmxs1tlb36nqcw853wkm0000gn/T/tmpxbcb2i91/_sigmoid.c' -> './_sigmoid.c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/tests/test_compilation.py", line 55, in test_compile_link_import_strings
    mod, info = compile_link_import_strings(_sources1, compile_kwargs=compile_kw)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 573, in compile_link_import_strings
    mod = compile_link_import_py_ext(source_files, build_dir=build_dir, **kwargs)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 518, in compile_link_import_py_ext
    objs = compile_sources(list(map(get_abspath, sources)), destdir=build_dir,
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 89, in compile_sources
    dstpaths.append(src2obj(f, Runner, cwd=cwd, **file_kwargs))
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 358, in src2obj
    return pyx2obj(srcpath, objpath=objpath, include_dirs=include_dirs, cwd=cwd,
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 438, in pyx2obj
    interm_c_file = simple_cythonize(pyxpath, destdir=destdir, cwd=cwd, **cy_kwargs)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/_compilation/compilation.py", line 297, in simple_cythonize
    shutil.move(os.path.join(os.path.dirname(src), c_name), destdir)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/shutil.py", line 835, in move
    copy_function(src, real_dst)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/shutil.py", line 444, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Users/aaronmeurer/anaconda3/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/wc/dppcpmxs1tlb36nqcw853wkm0000gn/T/tmpxbcb2i91/_sigmoid.c'

_________________________________________________________________________________________________________________________________________________________________________
_______________________________________________ sympy/integrals/rubi/parsetools/tests/test_parse.py:test_rubi_rule_parser _______________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/parsetools/tests/test_parse.py", line 51, in test_rubi_rule_parser
    assert len(result_rule.strip()) == len(rules.strip()) # failing randomly while using `result.strip() == rules`
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_________________________________________________ sympy/integrals/rubi/parsetools/tests/test_parse.py:test_replaceWith __________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/parsetools/tests/test_parse.py", line 89, in test_replaceWith
    assert replaceWith(s, symbols, 1) == ("    def With1(x, a, n, b):\n        r = Numerator(Rt(a/b, n))\n        s = Denominator(Rt(a/b, n))\n        k = Symbol('k')\n        u = Symbol('u')\n        u = Integral((r - s*x*cos(Pi*(S(2)*k + S(-1))/n))/(r**S(2) - S(2)*r*s*x*cos(Pi*(S(2)*k + S(-1))/n) + s**S(2)*x**S(2)), x)\n        u = Integral((r - s*x*cos(Pi*(2*k - 1)/n))/(r**2 - 2*r*s*x*cos(Pi*(2*k - 1)/n) + s**2*x**2), x)\n        rubi.append(1)\n        return Dist(S(2)*r/(a*n), _Sum(u, List(k, S(1), n/S(2) + S(-1)/2)), x) + r*Integral(S(1)/(r + s*x), x)/(a*n)", ' ', None)
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_________________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_Denominator __________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 237, in test_Denominator
    assert Denominator(-S(1)/S(2) + I/3) == 6
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
___________________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_AppellF1 ___________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 263, in test_AppellF1
    assert unchanged(AppellF1, a, b, c, d, e, f)
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
__________________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_Numerator ___________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 521, in test_Numerator
    assert Numerator(-S(1)/S(2) + I/3) == -3 + 2*I
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
___________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_GeneralizedBinomialParts ___________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 799, in test_GeneralizedBinomialParts
    assert GeneralizedBinomialParts(3*x*(3 + x**6), x) == [9, 3, 7, 1]
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
__________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_GeneralizedBinomialDegree ___________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 803, in test_GeneralizedBinomialDegree
    assert GeneralizedBinomialDegree(3*x*(3 + x**6), x) == 6
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_______________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_ExpandIntegrand ________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 1931, in test_ExpandIntegrand
    assert ExpandIntegrand((a + b*x)**S(3)*(A + B*x)/(c + d*x), x) == B*(a + b*x)**3/d + b*(a + b*x)**2*(A*d - B*c)/d**2 + b*(a + b*x)*(A*d - B*c)*(a*d - b*c)/d**3 + b*(A*d - B*c)*(a*d - b*c)**2/d**4 + (A*d - B*c)*(a*d - b*c)**3/(d**4*(c + d*x))
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_________________________________________________ sympy/integrals/rubi/tests/test_utility_function.py:test_Discriminant _________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/integrals/rubi/tests/test_utility_function.py", line 2071, in test_Discriminant
    assert unchanged(Discriminant, 1/x, x)
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
___________________________________________________ sympy/physics/control/tests/test_control_plots.py:test_pole_zero ____________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/physics/control/tests/test_control_plots.py", line 99, in test_pole_zero
    assert _to_tuple(*pole_zero_numerical_data(tf1)) == \
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
________________________________________________ sympy/physics/control/tests/test_control_plots.py:test_impulse_response ________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/physics/control/tests/test_control_plots.py", line 200, in test_impulse_response
    assert impulse_res_tester(tf3, exp3)
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_________________________________________________ sympy/physics/control/tests/test_control_plots.py:test_step_response __________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/physics/control/tests/test_control_plots.py", line 249, in test_step_response
    assert step_res_tester(tf3, exp3)
AssertionError
_________________________________________________________________________________________________________________________________________________________________________
_________________________________________________ sympy/physics/control/tests/test_control_plots.py:test_ramp_response __________________________________________________
Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/physics/control/tests/test_control_plots.py", line 291, in test_ramp_response
    assert ramp_res_tester(tf3, 10, exp3, 1.5)
AssertionError

Additionally, several warnings are printed in the test output.

sympy/geometry/tests/test_point.py[13] /Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/geometry/point.py:148: UserWarning: Dimension of (0, 0) needs to be changed from 2 to 3.
  warnings.warn(message)
.............                                                                                                                 [OK]
sympy/plotting/pygletplot/tests/test_plotting.py[10] ....<lambdifygenerated-122>:2: RuntimeWarning: divide by zero encountered in double_scalars
  return [cos(x)/x, sin(x)/x, 0.0]
<lambdifygenerated-122>:2: RuntimeWarning: invalid value encountered in double_scalars
  return [cos(x)/x, sin(x)/x, 0.0]
.<lambdifygenerated-123>:2: RuntimeWarning: divide by zero encountered in double_scalars
  return [cos(x)/y, sin(x)/y, y]
<lambdifygenerated-123>:2: RuntimeWarning: invalid value encountered in double_scalars
  return [cos(x)/y, sin(x)/y, y]
.../Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/plotting/pygletplot/util.py:124: RuntimeWarning: invalid value encountered in double_scalars
  return (a_value - a_min) / float(a_range)
./Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/plotting/pygletplot/util.py:124: RuntimeWarning: invalid value encountered in double_scalars
  return (a_value - a_min) / float(a_range)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/plotting/pygletplot/util.py:124: RuntimeWarning: invalid value encountered in double_scalars
  return (a_value - a_min) / float(a_range)
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/plotting/pygletplot/util.py:124: RuntimeWarning: invalid value encountered in double_scalars
  return (a_value - a_min) / float(a_range)
.                                                                                                      [OK]
sympy/plotting/tests/test_experimental_lambdify.py[2] ..                                                                                                             [OK]
sympy/plotting/tests/test_plot.py[22] ..../Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/plotting/experimental_lambdify.py:142: UserWarning: The evaluation of the expression is problematic. We are trying a failback method that may still work. Please report this as a bug.
  warnings.warn(
.<string>:1: RuntimeWarning: invalid value encountered in double_scalars
<string>:1: RuntimeWarning: invalid value encountered in double_scalars
.....<string>:1: RuntimeWarning: invalid value encountered in double_scalars
............                                                                                                         [OK]
sympy/plotting/tests/test_plot_implicit.py[3] ...                                                                                                                    [OK]
sympy/plotting/tests/test_textplot.py[4] .<lambdifygenerated-134>:2: RuntimeWarning: divide by zero encountered in log
  return log(x)
.<lambdifygenerated-135>:2: RuntimeWarning: invalid value encountered in double_scalars
  return sin(x)/x
.<lambdifygenerated-136>:2: RuntimeWarning: invalid value encountered in sqrt
  return sqrt(x)
.                                                                                                                        [OK]
sympy/stats/sampling/tests/test_sample_continuous_rv.py[8] ..s..../Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/numpy/lib/function_base.py:2387: RuntimeWarning: invalid value encountered in _cdf_single (vectorized)
  outputs = ufunc(*inputs)
.                                                                                                  [OK]
sympy/utilities/tests/test_lambdify.py[115] ....................../Users/aaronmeurer/anaconda3/lib/python3.9/site-packages/numexpr/expressions.py:189: RuntimeWarning: invalid value encountered in log
  return ConstantNode(func(*[x.value for x in args]))
.............................ssssssssss..................................................sss.      [OK]

Here is my tests header

executable:         /Users/aaronmeurer/anaconda3/bin/python  (3.9.9-final-0) [CPython]
architecture:       64-bit
cache:              yes
ground types:       gmpy 2.1.2
numpy:              1.22.1
random seed:        57358786
hash randomization: on (PYTHONHASHSEED=717137369)

It's possible some of these are due to me having some optional dependencies misconfigured in my environment. Although if it's just because I have a version of a dependency installed that is too old, it would be better for the test to be skipped in that case.

We should consider making all warnings, not just deprecation warnings, raise during the tests and require that any expected warnings be caught with the warns context manager.

Metadata

Assignees

No one assigned

    Labels

    UncategorisedDoesn't fit other labels...

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions