[Debian-astro-commits] [python-astropy] 01/04: Changing parametrized tests pytest 3.2.0 compatible
Ole Streicher
olebole at moszumanska.debian.org
Sat Aug 12 12:52:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
olebole pushed a commit to branch master
in repository python-astropy.
commit e9546d1216ad908478d6fea005ed23f43fd183c7
Author: Ole Streicher <olebole at debian.org>
Date: Sat Aug 12 14:43:42 2017 +0200
Changing parametrized tests pytest 3.2.0 compatible
---
debian/control | 4 +-
...arametrized-tests-pytest-3.2.0-compatible.patch | 129 +++++++++++++++++++++
debian/patches/mark_known_failures.patch | 10 +-
debian/patches/series | 1 +
4 files changed, 137 insertions(+), 7 deletions(-)
diff --git a/debian/control b/debian/control
index a90149f..d6059c7 100644
--- a/debian/control
+++ b/debian/control
@@ -23,7 +23,7 @@ Build-Depends: cython,
python-nose,
python-numpy (>= 1.4),
python-ply (>= 3.5),
- python-pytest (>= 2.7.0),
+ python-pytest (>= 3.1),
python-pytest-mpl,
python-scipy,
python-setuptools (>= 0.6.4),
@@ -38,7 +38,7 @@ Build-Depends: cython,
python3-nose,
python3-numpy (>= 1:1.6.2),
python3-ply (>= 3.5),
- python3-pytest (>= 2.7.0),
+ python3-pytest (>= 3.1),
python3-pytest-mpl,
python3-scipy,
python3-setuptools (>= 0.6.4),
diff --git a/debian/patches/Changing-parametrized-tests-pytest-3.2.0-compatible.patch b/debian/patches/Changing-parametrized-tests-pytest-3.2.0-compatible.patch
new file mode 100644
index 0000000..adeec79
--- /dev/null
+++ b/debian/patches/Changing-parametrized-tests-pytest-3.2.0-compatible.patch
@@ -0,0 +1,129 @@
+From: Brigitta Sipocz <bsipocz at gmail.com>
+Date: Tue, 8 Aug 2017 15:00:19 +0100
+Subject: Changing parametrized tests pytest 3.2.0 compatible
+
+https://github.com/astropy/astropy/pull/6419
+---
+ astropy/coordinates/tests/test_finite_difference_velocities.py | 10 ++--------
+ astropy/io/ascii/tests/test_c_reader.py | 8 ++++----
+ astropy/utils/tests/test_data.py | 4 ++--
+ docs/development/testguide.rst | 2 +-
+ docs/install.rst | 2 +-
+ setup.py | 2 +-
+ 6 files changed, 11 insertions(+), 17 deletions(-)
+
+diff --git a/astropy/coordinates/tests/test_finite_difference_velocities.py b/astropy/coordinates/tests/test_finite_difference_velocities.py
+index 39e8075..f642024 100644
+--- a/astropy/coordinates/tests/test_finite_difference_velocities.py
++++ b/astropy/coordinates/tests/test_finite_difference_velocities.py
+@@ -174,14 +174,8 @@ _xfail = pytest.mark.xfail
+
+ @pytest.mark.parametrize('distance', [1000*u.au,
+ 10*u.pc,
+- pytest.mark.xfail(10*u.kpc),
+- pytest.mark.xfail(100*u.kpc)])
+- # below is xfail syntax for pytest >=3.1
+- # TODO: change to this when the above
+- # way of xfailing is turned off in pytest
+- # >=4.0
+- # pytest.param(10*u.kpc, marks=_xfail),
+- # pytest.param(100*u.kpc, marks=_xfail)])
++ pytest.param(10*u.kpc, marks=_xfail),
++ pytest.param(100*u.kpc, marks=_xfail)])
+ # TODO: make these not fail when the
+ # finite-difference numerical stability
+ # is improved
+diff --git a/astropy/io/ascii/tests/test_c_reader.py b/astropy/io/ascii/tests/test_c_reader.py
+index f3bf89d..2af5cbf 100644
+--- a/astropy/io/ascii/tests/test_c_reader.py
++++ b/astropy/io/ascii/tests/test_c_reader.py
+@@ -964,7 +964,7 @@ def test_read_big_table(tmpdir):
+ @pytest.mark.parametrize('reader', [0, 1, 2])
+ # catch Windows environment since we cannot use _read() with custom fast_reader
+ @pytest.mark.parametrize("parallel", [False,
+- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True)])
++ pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows"))])
+ def test_data_out_of_range(parallel, reader):
+ """
+ Numbers with exponents beyond float64 range (|~4.94e-324 to 1.7977e+308|)
+@@ -1017,7 +1017,7 @@ def test_data_out_of_range(parallel, reader):
+
+ # catch Windows environment since we cannot use _read() with custom fast_reader
+ @pytest.mark.parametrize("parallel", [
+- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True),
++ pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")),
+ False])
+ def test_int_out_of_range(parallel):
+ """
+@@ -1056,7 +1056,7 @@ def test_int_out_of_range(parallel):
+
+
+ @pytest.mark.parametrize("parallel", [
+- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True),
++ pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows"))])
+ False])
+ def test_fortran_reader(parallel):
+ """
+@@ -1099,7 +1099,7 @@ def test_fortran_reader(parallel):
+
+
+ @pytest.mark.parametrize("parallel", [
+- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True),
++ pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows"))])
+ False])
+ def test_fortran_invalid_exp(parallel):
+ """
+diff --git a/astropy/utils/tests/test_data.py b/astropy/utils/tests/test_data.py
+index 2693a0a..e6c75d5 100644
+--- a/astropy/utils/tests/test_data.py
++++ b/astropy/utils/tests/test_data.py
+@@ -324,8 +324,8 @@ def test_data_noastropy_fallback(monkeypatch):
+ @pytest.mark.parametrize(('filename'), [
+ 'unicode.txt',
+ 'unicode.txt.gz',
+- pytest.mark.xfail(not HAS_BZ2, reason='no bz2 support')('unicode.txt.bz2'),
+- pytest.mark.xfail(not HAS_XZ, reason='no lzma support')('unicode.txt.xz')])
++ pytest.param('unicode.txt.bz2', marks=pytest.mark.xfail(not HAS_BZ2, reason='no bz2 support')),
++ pytest.param('unicode.txt.xz', marks=pytest.mark.xfail(not HAS_XZ, reason='no lzma support'))])
+ def test_read_unicode(filename):
+ from ..data import get_pkg_data_contents
+
+diff --git a/docs/development/testguide.rst b/docs/development/testguide.rst
+index b820c3a..6d29642 100644
+--- a/docs/development/testguide.rst
++++ b/docs/development/testguide.rst
+@@ -33,7 +33,7 @@ Running Tests
+ There are currently three different ways to invoke Astropy tests. Each
+ method invokes `pytest`_ to run the tests but offers different options when
+ calling. To run the tests, you will need to make sure you have the `pytest`_
+-package (version 2.8 or later) installed.
++package (version 3.1 or later) installed.
+
+ In addition to running the Astropy tests, these methods can also be called
+ so that they check Python source code for `PEP8 compliance
+diff --git a/docs/install.rst b/docs/install.rst
+index 3029bd7..b019edf 100644
+--- a/docs/install.rst
++++ b/docs/install.rst
+@@ -15,7 +15,7 @@ Astropy has the following strict requirements:
+
+ - `Numpy`_ |minimum_numpy_version| or later
+
+-- `pytest`_ 2.8 or later
++- `pytest`_ 3.1 or later
+
+ Astropy also depends on other packages for optional features:
+
+diff --git a/setup.py b/setup.py
+index 7ae5251..d4ed27b 100755
+--- a/setup.py
++++ b/setup.py
+@@ -66,7 +66,7 @@ setup_requires = ['numpy>=' + astropy.__minimum_numpy_version__]
+ if not os.path.exists(os.path.join(os.path.dirname(__file__), 'PKG-INFO')):
+ setup_requires.extend(['cython>=0.21', 'jinja2>=2.7'])
+
+-install_requires = ['pytest>=2.8', 'numpy>=' + astropy.__minimum_numpy_version__]
++install_requires = ['pytest>=3.1', 'numpy>=' + astropy.__minimum_numpy_version__]
+ # Avoid installing setup_requires dependencies if the user just
+ # queries for information
+ if is_distutils_display_option():
diff --git a/debian/patches/mark_known_failures.patch b/debian/patches/mark_known_failures.patch
index c597e60..4298d41 100644
--- a/debian/patches/mark_known_failures.patch
+++ b/debian/patches/mark_known_failures.patch
@@ -9,15 +9,15 @@ Subject: Mark all known test failures as xfail. These failures have been
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/astropy/io/ascii/tests/test_c_reader.py b/astropy/io/ascii/tests/test_c_reader.py
-index f3bf89d..bab24b0 100644
+index 2af5cbf..c8aaab3 100644
--- a/astropy/io/ascii/tests/test_c_reader.py
+++ b/astropy/io/ascii/tests/test_c_reader.py
@@ -1056,7 +1056,7 @@ def test_int_out_of_range(parallel):
@pytest.mark.parametrize("parallel", [
-- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True),
-+ pytest.mark.xfail(reason="see https://github.com/astropy/astropy/issues/5693")(True),
+- pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows"))])
++ pytest.param(True, marks=pytest.mark.xfail(reason="see https://github.com/astropy/astropy/issues/5693")),
False])
def test_fortran_reader(parallel):
"""
@@ -25,8 +25,8 @@ index f3bf89d..bab24b0 100644
@pytest.mark.parametrize("parallel", [
-- pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows")(True),
-+ pytest.mark.xfail(reason= "see https://github.com/astropy/astropy/issues/5693")(True),
+- pytest.param(True, marks=pytest.mark.xfail(os.name == 'nt', reason="Multiprocessing is currently unsupported on Windows"))])
++ pytest.param(True, marks=pytest.mark.xfail(reason="see https://github.com/astropy/astropy/issues/5693")),
False])
def test_fortran_invalid_exp(parallel):
"""
diff --git a/debian/patches/series b/debian/patches/series
index 69494b6..0c44e4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
disable_helper.patch
only_python3-binaries.patch
+Changing-parametrized-tests-pytest-3.2.0-compatible.patch
mark_known_failures.patch
external_python_pkgs.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/python-astropy.git
More information about the Debian-astro-commits
mailing list