Skip to content
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

Updated slow tests and removed a few XFAIL #16010

Merged
merged 16 commits into from Feb 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .travis.yml
Expand Up @@ -88,11 +88,23 @@ matrix:
- python: 2.7
env:
- TEST_SLOW="true"
- SPLIT="1/2"
- python: 2.7
env:
- TEST_SLOW="true"
- SPLIT="2/2"
- python: 3.7
dist: xenial
sudo: true
env:
- TEST_SLOW="true"
- SPLIT="1/2"
- python: 3.7
dist: xenial
sudo: true
env:
- TEST_SLOW="true"
- SPLIT="2/2"

# Everything here and below is in the allow_failures. The need to be
# duplicated here and in that section below.
Expand Down
15 changes: 10 additions & 5 deletions sympy/assumptions/tests/test_query.py
Expand Up @@ -1176,7 +1176,8 @@ def test_complex():
assert ask(Q.complex(im(x))) is True


def test_even():
@slow
def test_even_query():
assert ask(Q.even(x)) is None
assert ask(Q.even(x), Q.integer(x)) is None
assert ask(Q.even(x), ~Q.integer(x)) is False
Expand Down Expand Up @@ -1330,6 +1331,7 @@ def test_rational():
assert ask(Q.rational(h(x)), Q.rational(x)) is False


@slow
def test_hermitian():
assert ask(Q.hermitian(x)) is None
assert ask(Q.hermitian(x), Q.antihermitian(x)) is False
Expand Down Expand Up @@ -1535,6 +1537,7 @@ def test_integer():
assert ask(Q.integer(x/3), Q.even(x)) is None


@slow
def test_negative():
assert ask(Q.negative(x), Q.negative(x)) is True
assert ask(Q.negative(x), Q.positive(x)) is False
Expand Down Expand Up @@ -1606,6 +1609,7 @@ def test_nonzero():
assert ask(Q.nonzero(cos(1)**2 + sin(1)**2 - 1)) is None


@slow
def test_zero():
assert ask(Q.zero(x)) is None
assert ask(Q.zero(x), Q.real(x)) is None
Expand Down Expand Up @@ -1636,7 +1640,8 @@ def test_zero():
assert ask(Q.zero(x) | Q.zero(y), Q.zero(x*y)) is True


def test_odd():
@slow
def test_odd_query():
assert ask(Q.odd(x)) is None
assert ask(Q.odd(x), Q.odd(x)) is True
assert ask(Q.odd(x), Q.integer(x)) is None
Expand Down Expand Up @@ -1741,6 +1746,7 @@ def test_prime():
assert ask(Q.prime(x**y), Q.integer(x) & Q.integer(y)) is False


@slow
def test_positive():
assert ask(Q.positive(x), Q.positive(x)) is True
assert ask(Q.positive(x), Q.negative(x)) is False
Expand Down Expand Up @@ -2239,9 +2245,8 @@ def test_issue_9636():
assert ask(Q.odd(3.0)) is False


@XFAIL
def test_autosimp_fails():
# Unxfail after fixing issue #9807
def test_autosimp_used_to_fail():
# See issue #9807
assert ask(Q.imaginary(0**I)) is False
assert ask(Q.imaginary(0**(-I))) is False
assert ask(Q.real(0**I)) is False
Expand Down
1 change: 0 additions & 1 deletion sympy/assumptions/tests/test_refine.py
Expand Up @@ -16,7 +16,6 @@ def test_Abs():
assert refine(Abs(x**2), Q.real(x)) == x**2


@slow
def test_pow1():
assert refine((-1)**x, Q.even(x)) == 1
assert refine((-1)**x, Q.odd(x)) == -1
Expand Down
7 changes: 4 additions & 3 deletions sympy/assumptions/tests/test_satask.py
Expand Up @@ -2,7 +2,7 @@

from sympy import symbols, Q, assuming, Implies, MatrixSymbol, I, pi, Rational

from sympy.utilities.pytest import raises, XFAIL
from sympy.utilities.pytest import raises, XFAIL, slow


x, y, z = symbols('x y z')
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_rational_irrational():
Q.rational(z)) is True


def test_even():
def test_even_satask():
assert satask(Q.even(2)) is True
assert satask(Q.even(3)) is False

Expand All @@ -181,7 +181,7 @@ def test_even():
assert satask(Q.even(x), Q.even(abs(x))) is None # x could be complex


def test_odd():
def test_odd_satask():
assert satask(Q.odd(2)) is False
assert satask(Q.odd(3)) is True

Expand Down Expand Up @@ -264,6 +264,7 @@ def test_pos_neg():
assert satask(Q.negative(x + y), Q.positive(x) & Q.positive(y)) is False


@slow
def test_pow_pos_neg():
assert satask(Q.nonnegative(x**2), Q.positive(x)) is True
assert satask(Q.nonpositive(x**2), Q.positive(x)) is False
Expand Down
3 changes: 3 additions & 0 deletions sympy/combinatorics/tests/test_coset_table.py
Expand Up @@ -5,6 +5,8 @@
from sympy.combinatorics.coset_table import modified_coset_enumeration_r
from sympy.combinatorics.free_groups import free_group

from sympy.utilities.pytest import slow

"""
References
==========
Expand Down Expand Up @@ -122,6 +124,7 @@ def test_scan_1():
assert c.omega == [0, 1, 2, 3]


@slow
def test_coset_enumeration():
# this test function contains the combined tests for the two strategies
# i.e. HLT and Felsch strategies.
Expand Down
4 changes: 3 additions & 1 deletion sympy/combinatorics/tests/test_fp_groups.py
Expand Up @@ -4,6 +4,8 @@
reidemeister_presentation, FpSubgroup)
from sympy.combinatorics.free_groups import free_group

from sympy.utilities.pytest import slow

"""
References
==========
Expand Down Expand Up @@ -146,8 +148,8 @@ def test_subgroup_presentations():
assert len(rels) == 18


@slow
def test_order():
from sympy import S
F, x, y = free_group("x, y")
f = FpGroup(F, [x**4, y**2, x*y*x**-1*y])
assert f.order() == 8
Expand Down
4 changes: 3 additions & 1 deletion sympy/combinatorics/tests/test_perm_groups.py
Expand Up @@ -9,7 +9,7 @@
from sympy.combinatorics.polyhedron import tetrahedron as Tetra, cube
from sympy.combinatorics.testutil import _verify_bsgs, _verify_centralizer,\
_verify_normal_closure
from sympy.utilities.pytest import raises
from sympy.utilities.pytest import raises, slow

rmul = Permutation.rmul

Expand Down Expand Up @@ -854,6 +854,8 @@ def test_sylow_subgroup():
assert G.order() % S.order() == 0
assert G.order()/S.order() % 2 > 0


@slow
def test_presentation():
def _test(P):
G = P.presentation()
Expand Down
8 changes: 4 additions & 4 deletions sympy/concrete/tests/test_sums_products.py
@@ -1,13 +1,12 @@
from sympy import (
Abs, And, binomial, Catalan, cos, Derivative, E, Eq, exp, EulerGamma,
factorial, Function, harmonic, I, Integral, KroneckerDelta, log,
nan, Ne, Or, oo, pi, Piecewise, Product, product, Rational, S, simplify,
nan, oo, pi, Piecewise, Product, product, Rational, S, simplify,
sin, sqrt, Sum, summation, Symbol, symbols, sympify, zeta, gamma, Le,
Indexed, Idx, IndexedBase, prod, Dummy, lowergamma)
from sympy.abc import a, b, c, d, f, k, m, x, y, z
from sympy.abc import a, b, c, d, k, m, x, y, z
from sympy.concrete.summations import telescopic
from sympy.utilities.pytest import XFAIL, raises
from sympy import simplify
from sympy.utilities.pytest import XFAIL, raises, slow
from sympy.matrices import Matrix
from sympy.core.mod import Mod
from sympy.core.compatibility import range
Expand Down Expand Up @@ -403,6 +402,7 @@ def check_exact(f, a, b, m, n):
raises(ValueError, lambda: Sum(1, (x, 0, 1), (k, 0, 1)).euler_maclaurin())


@slow
def test_evalf_euler_maclaurin():
assert NS(Sum(1/k**k, (k, 1, oo)), 15) == '1.29128599706266'
assert NS(Sum(1/k**k, (k, 1, oo)),
Expand Down
3 changes: 2 additions & 1 deletion sympy/functions/combinatorial/tests/test_comb_factorials.py
Expand Up @@ -4,7 +4,7 @@
Eq, sqrt, Poly)
from sympy.functions.combinatorial.factorials import subfactorial
from sympy.functions.special.gamma_functions import uppergamma
from sympy.utilities.pytest import XFAIL, raises
from sympy.utilities.pytest import XFAIL, raises, slow

#Solves and Fixes Issue #10388 - This is the updated test for the same solved issue

Expand Down Expand Up @@ -434,6 +434,7 @@ def test_binomial():
assert isinstance(binomial(I, n), binomial)


@slow
def test_binomial_Mod():
p, q = 10**5 + 3, 10**9 + 33 # prime modulo
r, s = 10**7 + 5, 33333333 # composite modulo
Expand Down
4 changes: 3 additions & 1 deletion sympy/functions/elementary/tests/test_piecewise.py
Expand Up @@ -5,7 +5,7 @@
cos, sin, exp, Abs, Ne, Not, Symbol, S, sqrt, Tuple, zoo,
factor_terms, DiracDelta, Heaviside, Add, Mul, factorial)
from sympy.printing import srepr
from sympy.utilities.pytest import XFAIL, raises
from sympy.utilities.pytest import raises, slow

from sympy.functions.elementary.piecewise import Undefined

Expand Down Expand Up @@ -209,6 +209,7 @@ def test_piecewise_integrate1b():
(y - 1, True))


@slow
def test_piecewise_integrate1c():
y = symbols('y', real=True)
for i, g in enumerate([
Expand Down Expand Up @@ -288,6 +289,7 @@ def test_piecewise_integrate3_inequality_conditions():
# values


@slow
def test_piecewise_integrate4_symbolic_conditions():
a = Symbol('a', real=True, finite=True)
b = Symbol('b', real=True, finite=True)
Expand Down
2 changes: 2 additions & 0 deletions sympy/functions/special/tests/test_bsplines.py
Expand Up @@ -2,6 +2,7 @@
from sympy.core.compatibility import range
from sympy import Piecewise, Interval, And
from sympy import symbols, Rational, sympify as S
from sympy.utilities.pytest import slow

x, y = symbols('x,y')

Expand Down Expand Up @@ -137,6 +138,7 @@ def test_5_points_degree_2():
(-1319*x**2/1645 + 21101*x/1645 - S(11216)/329, (x >= S(9)/2) & (x <= 10)))


@slow
def test_6_points_degree_3():
d = 3
X = [-1, 0, 2, 3, 9, 12]
Expand Down
3 changes: 2 additions & 1 deletion sympy/functions/special/tests/test_error_functions.py
Expand Up @@ -13,7 +13,7 @@

from sympy.core.function import ArgumentIndexError

from sympy.utilities.pytest import raises
from sympy.utilities.pytest import raises, slow

x, y, z = symbols('x,y,z')
w = Symbol("w", real=True)
Expand Down Expand Up @@ -563,6 +563,7 @@ def test_ci():
assert limit(log(x) - Ci(2*x), x, 0) == -log(2) - EulerGamma


@slow
def test_fresnel():
assert fresnels(0) == 0
assert fresnels(oo) == S.Half
Expand Down
4 changes: 3 additions & 1 deletion sympy/geometry/tests/test_ellipse.py
Expand Up @@ -2,7 +2,7 @@
from sympy.core.compatibility import range
from sympy.geometry import (Circle, Ellipse, GeometryError, Line, Point, Polygon, Ray, RegularPolygon, Segment,
Triangle, intersection)
from sympy.utilities.pytest import raises
from sympy.utilities.pytest import raises, slow
from sympy import integrate
from sympy.functions.special.elliptic_integrals import elliptic_e
from sympy.functions.elementary.miscellaneous import Max
Expand Down Expand Up @@ -41,6 +41,7 @@ def test_object_from_equation():
raises(ValueError, lambda: Circle(a**2 + b**2 + 3*a + 4*b - 8))


@slow
def test_ellipse_geom():
x = Symbol('x', real=True)
y = Symbol('y', real=True)
Expand Down Expand Up @@ -437,6 +438,7 @@ def test_parameter_value():
raises(ValueError, lambda: e.parameter_value((4, 0), t))


@slow
def test_second_moment_of_area():
x, y = symbols('x, y')
e = Ellipse(Point(0, 0), 5, 4)
Expand Down
5 changes: 2 additions & 3 deletions sympy/geometry/tests/test_plane.py
@@ -1,10 +1,9 @@
from sympy import Dummy, S, Symbol, symbols, pi, sqrt, asin, sin, cos
from sympy import Dummy, S, symbols, pi, sqrt, asin, sin, cos
from sympy.geometry import Line, Point, Ray, Segment, Point3D, Line3D, Ray3D, Segment3D, Plane
from sympy.geometry.util import are_coplanar
from sympy.utilities.pytest import raises, slow
from sympy.utilities.pytest import raises


@slow
def test_plane():
x, y, z, u, v = symbols('x y z u v', real=True)
p1 = Point3D(0, 0, 0)
Expand Down
1 change: 0 additions & 1 deletion sympy/integrals/tests/test_failing_integrals.py
Expand Up @@ -33,7 +33,6 @@ def test_issue_4491():


@XFAIL
@slow
def test_issue_4511():
# This works, but gives a complicated answer. The correct answer is x - cos(x).
# The last one is what Maple gives. It is also quite slow.
Expand Down
1 change: 0 additions & 1 deletion sympy/integrals/tests/test_heurisch.py
Expand Up @@ -244,7 +244,6 @@ def test_pmint_logexp():

assert ratsimp(heurisch(f, x)) == g

@slow # 8 seconds on 3.4 GHz
@XFAIL # there's a hash dependent failure lurking here
def test_pmint_erf():
f = exp(-x**2)*erf(x)/(erf(x)**3 - erf(x)**2 - erf(x) + 1)
Expand Down
2 changes: 2 additions & 0 deletions sympy/integrals/tests/test_integrals.py
Expand Up @@ -1301,6 +1301,8 @@ def test_issue_8901():
assert integrate(tanh(1.0*x)) == 1.0*x - 1.0*log(tanh(1.0*x) + 1)
assert integrate(tanh(x)) == x - log(tanh(x) + 1)


@slow
def test_issue_8945():
assert integrate(sin(x)**3/x, (x, 0, 1)) == -Si(3)/4 + 3*Si(1)/4
assert integrate(sin(x)**3/x, (x, 0, oo)) == pi/4
Expand Down
2 changes: 2 additions & 0 deletions sympy/integrals/tests/test_intpoly.py
Expand Up @@ -10,6 +10,7 @@
from sympy.geometry.point import Point, Point2D
from sympy.abc import x, y, z

from sympy.utilities.pytest import slow


def test_decompose():
Expand Down Expand Up @@ -53,6 +54,7 @@ def test_best_origin():
assert best_origin((1, 1), 2, l6, x ** 9 * y ** 2) == (2, 0)


@slow
def test_polytope_integrate():
# Convex 2-Polytopes
# Vertex representation
Expand Down
4 changes: 4 additions & 0 deletions sympy/integrals/tests/test_manual.py
Expand Up @@ -8,6 +8,7 @@
sinh, cosh, elliptic_f, elliptic_e)
from sympy.integrals.manualintegrate import (manualintegrate, find_substitutions,
_parts_rule, integral_steps, contains_dont_know, manual_subs)
from sympy.utilities.pytest import slow

x, y, z, u, n, a, b, c = symbols('x y z u n a b c')
f = Function('f')
Expand Down Expand Up @@ -354,6 +355,7 @@ def test_issue_6746():
Integral(1/(-a**x + b**2*x + x), x)


@slow
def test_issue_2850():
assert manualintegrate(asin(x)*log(x), x) == -x*asin(x) - sqrt(-x**2 + 1) \
+ (x*asin(x) + sqrt(-x**2 + 1))*log(x) - Integral(sqrt(-x**2 + 1)/x, x)
Expand All @@ -380,6 +382,7 @@ def test_cyclic_parts():
assert manualintegrate(f, x) == F and F.diff(x) == f


@slow
def test_issue_10847():
assert manualintegrate(x**2 / (x**2 - c), x) == c*Piecewise((atan(x/sqrt(-c))/sqrt(-c), -c > 0), \
(-acoth(x/sqrt(c))/sqrt(c), And(-c < 0, x**2 > c)), \
Expand Down Expand Up @@ -440,6 +443,7 @@ def test_issue_14470():
log(-1 + 1/sqrt(x + 1)) - log(1 + 1/sqrt(x + 1))


@slow
def test_issue_9858():
assert manualintegrate(exp(x)*cos(exp(x)), x) == sin(exp(x))
assert manualintegrate(exp(2*x)*cos(exp(x)), x) == \
Expand Down