Fix tests for python 3.5.
This commit is contained in:
parent
0e10ede896
commit
ed4d3a454d
26
sympy.spec
26
sympy.spec
|
@ -89,17 +89,38 @@ HTML documentation for sympy.
|
||||||
rm -rf sympy/mpmath doc/src/modules/mpmath
|
rm -rf sympy/mpmath doc/src/modules/mpmath
|
||||||
rm -rf %{name}-%{version}/sympy/mpmath %{name}-%{version}/doc/src/module/mpmath
|
rm -rf %{name}-%{version}/sympy/mpmath %{name}-%{version}/doc/src/module/mpmath
|
||||||
|
|
||||||
|
fixtimestamp() {
|
||||||
|
touch -r $1.orig $1
|
||||||
|
rm -f $1.org
|
||||||
|
}
|
||||||
|
|
||||||
# One plotting test expects one warning, but the same warning is triggered in
|
# One plotting test expects one warning, but the same warning is triggered in
|
||||||
# a different spot with recent versions of python, leading to an assertion
|
# a different spot with recent versions of python, leading to an assertion
|
||||||
# failure.
|
# failure.
|
||||||
sed -e '/import warnings/ifrom sympy.utilities.pytest import XFAIL' \
|
sed -e '/import warnings/ifrom sympy.utilities.pytest import XFAIL' \
|
||||||
-e '/^def test_matplotlib():/i@XFAIL' \
|
-e '/^def test_matplotlib():/i@XFAIL' \
|
||||||
-i sympy/plotting/tests/test_plot_implicit.py
|
-i.orig sympy/plotting/tests/test_plot_implicit.py
|
||||||
|
fixtimestamp sympy/plotting/tests/test_plot_implicit.py
|
||||||
|
|
||||||
# Make a copy for building the python3 version
|
# Make a copy for building the python3 version
|
||||||
rm -rf %{py3dir}
|
rm -rf %{py3dir}
|
||||||
cp -a . %{py3dir}
|
cp -a . %{py3dir}
|
||||||
|
|
||||||
|
# Handle a new way eval() can fail in python 3.5
|
||||||
|
sed -e 's/SyntaxError/&, TypeError/' \
|
||||||
|
-e 's/unbound method/contains() missing 1 required positional argument/' \
|
||||||
|
-i.orig %{py3dir}/sympy/core/sympify.py
|
||||||
|
|
||||||
|
TypeError: contains() missing 1 required positional argument: 'expr'
|
||||||
|
|
||||||
|
fixtimestamp %{py3dir}/sympy/core/sympify.py
|
||||||
|
|
||||||
|
# Handle two changes in an error message in python 3.5
|
||||||
|
sed -e 's/ in test\.globs/, test.globs)/' \
|
||||||
|
-e 's/RuntimeError/RecursionError/' \
|
||||||
|
-i.orig %{py3dir}/doc/src/gotchas.rst
|
||||||
|
fixtimestamp %{py3dir}/doc/src/gotchas.rst
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Build the python2 version
|
# Build the python2 version
|
||||||
python2 setup.py build
|
python2 setup.py build
|
||||||
|
@ -157,9 +178,6 @@ rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n
|
||||||
cp -p %{py3dir}/doc/_build/cheatsheet/combinatoric_cheatsheet.pdf .
|
cp -p %{py3dir}/doc/_build/cheatsheet/combinatoric_cheatsheet.pdf .
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# The python3 tests fail with Unicode errors without this
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
|
|
||||||
let "dnum = $RANDOM % 90 + 10"
|
let "dnum = $RANDOM % 90 + 10"
|
||||||
xvfb-run -n $dnum python2 setup.py test
|
xvfb-run -n $dnum python2 setup.py test
|
||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
|
|
Loading…
Reference in New Issue