diff options
author | Ole Streicher <olebole@debian.org> | 2018-12-06 16:50:23 +0100 |
---|---|---|
committer | Ole Streicher <olebole@debian.org> | 2018-12-06 16:50:23 +0100 |
commit | 2241ffbbe69f1a9c17608ae9d16ba5b34414ed3d (patch) | |
tree | ef908e6f1a5bc033edd34980e8e97951842f6316 | |
parent | 90c463f571e7bed7d64e136ad65f273a1f4118c9 (diff) |
New upstream version 0.3
-rw-r--r-- | CHANGES.md | 5 | ||||
-rw-r--r-- | PKG-INFO | 54 | ||||
-rw-r--r-- | README.rst | 52 | ||||
-rw-r--r-- | pytest_arraydiff.egg-info/PKG-INFO | 54 | ||||
-rw-r--r-- | pytest_arraydiff.egg-info/SOURCES.txt | 1 | ||||
-rw-r--r-- | pytest_arraydiff.egg-info/not-zip-safe | 1 | ||||
-rwxr-xr-x | pytest_arraydiff/__init__.py | 2 | ||||
-rwxr-xr-x | pytest_arraydiff/plugin.py | 6 | ||||
-rw-r--r-- | setup.cfg | 1 | ||||
-rwxr-xr-x | setup.py | 1 |
10 files changed, 67 insertions, 110 deletions
@@ -1,3 +1,8 @@ +0.3 (2018-12-05) +---------------- + +- Fixed compatibility with pytest 4+. [#15] + 0.2 (2018-01-29) ---------------- @@ -1,20 +1,20 @@ Metadata-Version: 1.1 Name: pytest-arraydiff -Version: 0.2 +Version: 0.3 Summary: pytest plugin to help with comparing array output from tests Home-page: https://github.com/astrofrog/pytest-arraydiff Author: Thomas Robitaille Author-email: thomas.robitaille@gmail.com License: BSD -Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| +Description: |Travis Build Status| |AppVeyor Build status| |Coverage| About ----- This is a `py.test <http://pytest.org>`__ plugin to facilitate the - generation and comparison of data arrays produced during tests (this is a - spin-off from - `pytest-arraydiff <https://github.com/astrofrog/pytest-arraydiff>`__). + generation and comparison of data arrays produced during tests, in particular + in cases where the arrays are too large to conveniently hard-code them + in the tests (e.g. ``np.testing.assert_allclose(x, [1, 2, 3])``). The basic idea is that you can write a test that generates a Numpy array (or other related objects depending on the format). You can then either run the @@ -38,21 +38,15 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| requires `pytest <http://pytest.org>`__ and `numpy <http://www.numpy.org>`__ to be installed. - To install, you can do: - - :: + To install, you can do:: pip install pytest-arraydiff - You can check that the plugin is registered with pytest by doing: - - :: + You can check that the plugin is registered with pytest by doing:: py.test --version - which will show a list of plugins: - - :: + which will show a list of plugins:: This is pytest version 2.7.1, imported from ... setuptools registered plugins: @@ -63,9 +57,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| To use, you simply need to mark the function where you want to compare arrays using ``@pytest.mark.array_compare``, and make sure that the - function returns a plain Numpy array: - - :: + function returns a plain Numpy array:: python import pytest @@ -77,9 +69,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| To generate the reference data files, run the tests with the ``--arraydiff-generate-path`` option with the name of the directory - where the generated files should be placed: - - :: + where the generated files should be placed:: py.test --arraydiff-generate-path=reference @@ -93,9 +83,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| name is configurable, see below). You can also generate the baseline arrays directly in the right directory. - You can then run the tests simply with: - - :: + You can then run the tests simply with:: py.test --arraydiff @@ -161,9 +149,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| end in a slash). Finally, you can also set a custom baseline directory globally when - running tests by running ``py.test`` with: - - :: + running tests by running ``py.test`` with:: py.test --arraydiff --arraydiff-reference-path=baseline_arrays @@ -177,9 +163,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| If the arrays produced by the tests are correct, then the test will pass, but if they are not, the test will fail with a message similar to - the following: - - :: + the following:: E AssertionError: E @@ -203,9 +187,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| -------------------------------------- If you are contributing some changes and want to run the tests, first - install the latest version of the plugin then do: - - :: + install the latest version of the plugin then do:: cd tests py.test --arraydiff @@ -215,10 +197,10 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| .. |Travis Build Status| image:: https://travis-ci.org/astrofrog/pytest-arraydiff.svg?branch=master :target: https://travis-ci.org/astrofrog/pytest-arraydiff - .. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/4hfoe954rxhgslsl/branch/master?svg=true - :target: https://ci.appveyor.com/project/astrofrog/pytest-arraydiff - .. |Coveralls coverage| image:: https://coveralls.io/repos/matplotlib/pytest-arraydiff/badge.svg - :target: https://coveralls.io/r/matplotlib/pytest-arraydiff + .. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/0nech6qgp8jlabjp/branch/master?svg=true + :target: https://ci.appveyor.com/project/astropy/pytest-arraydiff + .. |Coverage| image:: https://codecov.io/gh/astropy/pytest-arraydiff/branch/master/graph/badge.svg + :target: https://codecov.io/gh/astropy/pytest-arraydiff Platform: UNKNOWN Classifier: Development Status :: 4 - Beta @@ -1,12 +1,12 @@ -|Travis Build Status| |AppVeyor Build status| |Coveralls coverage| +|Travis Build Status| |AppVeyor Build status| |Coverage| About ----- This is a `py.test <http://pytest.org>`__ plugin to facilitate the -generation and comparison of data arrays produced during tests (this is a -spin-off from -`pytest-arraydiff <https://github.com/astrofrog/pytest-arraydiff>`__). +generation and comparison of data arrays produced during tests, in particular +in cases where the arrays are too large to conveniently hard-code them +in the tests (e.g. ``np.testing.assert_allclose(x, [1, 2, 3])``). The basic idea is that you can write a test that generates a Numpy array (or other related objects depending on the format). You can then either run the @@ -30,21 +30,15 @@ This plugin is compatible with Python 2.7, and 3.5 and later, and requires `pytest <http://pytest.org>`__ and `numpy <http://www.numpy.org>`__ to be installed. -To install, you can do: - -:: +To install, you can do:: pip install pytest-arraydiff -You can check that the plugin is registered with pytest by doing: - -:: +You can check that the plugin is registered with pytest by doing:: py.test --version -which will show a list of plugins: - -:: +which will show a list of plugins:: This is pytest version 2.7.1, imported from ... setuptools registered plugins: @@ -55,9 +49,7 @@ Using To use, you simply need to mark the function where you want to compare arrays using ``@pytest.mark.array_compare``, and make sure that the -function returns a plain Numpy array: - -:: +function returns a plain Numpy array:: python import pytest @@ -69,9 +61,7 @@ function returns a plain Numpy array: To generate the reference data files, run the tests with the ``--arraydiff-generate-path`` option with the name of the directory -where the generated files should be placed: - -:: +where the generated files should be placed:: py.test --arraydiff-generate-path=reference @@ -85,9 +75,7 @@ to a sub-directory called ``reference`` relative to the test files (this name is configurable, see below). You can also generate the baseline arrays directly in the right directory. -You can then run the tests simply with: - -:: +You can then run the tests simply with:: py.test --arraydiff @@ -153,9 +141,7 @@ also be a URL (which should start with ``http://`` or ``https://`` and end in a slash). Finally, you can also set a custom baseline directory globally when -running tests by running ``py.test`` with: - -:: +running tests by running ``py.test`` with:: py.test --arraydiff --arraydiff-reference-path=baseline_arrays @@ -169,9 +155,7 @@ Test failure example If the arrays produced by the tests are correct, then the test will pass, but if they are not, the test will fail with a message similar to -the following: - -:: +the following:: E AssertionError: E @@ -195,9 +179,7 @@ Running the tests for pytest-arraydiff -------------------------------------- If you are contributing some changes and want to run the tests, first -install the latest version of the plugin then do: - -:: +install the latest version of the plugin then do:: cd tests py.test --arraydiff @@ -207,7 +189,7 @@ plugin is correctly loaded as part of the test suite. .. |Travis Build Status| image:: https://travis-ci.org/astrofrog/pytest-arraydiff.svg?branch=master :target: https://travis-ci.org/astrofrog/pytest-arraydiff -.. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/4hfoe954rxhgslsl/branch/master?svg=true - :target: https://ci.appveyor.com/project/astrofrog/pytest-arraydiff -.. |Coveralls coverage| image:: https://coveralls.io/repos/matplotlib/pytest-arraydiff/badge.svg - :target: https://coveralls.io/r/matplotlib/pytest-arraydiff +.. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/0nech6qgp8jlabjp/branch/master?svg=true + :target: https://ci.appveyor.com/project/astropy/pytest-arraydiff +.. |Coverage| image:: https://codecov.io/gh/astropy/pytest-arraydiff/branch/master/graph/badge.svg + :target: https://codecov.io/gh/astropy/pytest-arraydiff diff --git a/pytest_arraydiff.egg-info/PKG-INFO b/pytest_arraydiff.egg-info/PKG-INFO index 93d9854..292b52e 100644 --- a/pytest_arraydiff.egg-info/PKG-INFO +++ b/pytest_arraydiff.egg-info/PKG-INFO @@ -1,20 +1,20 @@ Metadata-Version: 1.1 Name: pytest-arraydiff -Version: 0.2 +Version: 0.3 Summary: pytest plugin to help with comparing array output from tests Home-page: https://github.com/astrofrog/pytest-arraydiff Author: Thomas Robitaille Author-email: thomas.robitaille@gmail.com License: BSD -Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| +Description: |Travis Build Status| |AppVeyor Build status| |Coverage| About ----- This is a `py.test <http://pytest.org>`__ plugin to facilitate the - generation and comparison of data arrays produced during tests (this is a - spin-off from - `pytest-arraydiff <https://github.com/astrofrog/pytest-arraydiff>`__). + generation and comparison of data arrays produced during tests, in particular + in cases where the arrays are too large to conveniently hard-code them + in the tests (e.g. ``np.testing.assert_allclose(x, [1, 2, 3])``). The basic idea is that you can write a test that generates a Numpy array (or other related objects depending on the format). You can then either run the @@ -38,21 +38,15 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| requires `pytest <http://pytest.org>`__ and `numpy <http://www.numpy.org>`__ to be installed. - To install, you can do: - - :: + To install, you can do:: pip install pytest-arraydiff - You can check that the plugin is registered with pytest by doing: - - :: + You can check that the plugin is registered with pytest by doing:: py.test --version - which will show a list of plugins: - - :: + which will show a list of plugins:: This is pytest version 2.7.1, imported from ... setuptools registered plugins: @@ -63,9 +57,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| To use, you simply need to mark the function where you want to compare arrays using ``@pytest.mark.array_compare``, and make sure that the - function returns a plain Numpy array: - - :: + function returns a plain Numpy array:: python import pytest @@ -77,9 +69,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| To generate the reference data files, run the tests with the ``--arraydiff-generate-path`` option with the name of the directory - where the generated files should be placed: - - :: + where the generated files should be placed:: py.test --arraydiff-generate-path=reference @@ -93,9 +83,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| name is configurable, see below). You can also generate the baseline arrays directly in the right directory. - You can then run the tests simply with: - - :: + You can then run the tests simply with:: py.test --arraydiff @@ -161,9 +149,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| end in a slash). Finally, you can also set a custom baseline directory globally when - running tests by running ``py.test`` with: - - :: + running tests by running ``py.test`` with:: py.test --arraydiff --arraydiff-reference-path=baseline_arrays @@ -177,9 +163,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| If the arrays produced by the tests are correct, then the test will pass, but if they are not, the test will fail with a message similar to - the following: - - :: + the following:: E AssertionError: E @@ -203,9 +187,7 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| -------------------------------------- If you are contributing some changes and want to run the tests, first - install the latest version of the plugin then do: - - :: + install the latest version of the plugin then do:: cd tests py.test --arraydiff @@ -215,10 +197,10 @@ Description: |Travis Build Status| |AppVeyor Build status| |Coveralls coverage| .. |Travis Build Status| image:: https://travis-ci.org/astrofrog/pytest-arraydiff.svg?branch=master :target: https://travis-ci.org/astrofrog/pytest-arraydiff - .. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/4hfoe954rxhgslsl/branch/master?svg=true - :target: https://ci.appveyor.com/project/astrofrog/pytest-arraydiff - .. |Coveralls coverage| image:: https://coveralls.io/repos/matplotlib/pytest-arraydiff/badge.svg - :target: https://coveralls.io/r/matplotlib/pytest-arraydiff + .. |AppVeyor Build status| image:: https://ci.appveyor.com/api/projects/status/0nech6qgp8jlabjp/branch/master?svg=true + :target: https://ci.appveyor.com/project/astropy/pytest-arraydiff + .. |Coverage| image:: https://codecov.io/gh/astropy/pytest-arraydiff/branch/master/graph/badge.svg + :target: https://codecov.io/gh/astropy/pytest-arraydiff Platform: UNKNOWN Classifier: Development Status :: 4 - Beta diff --git a/pytest_arraydiff.egg-info/SOURCES.txt b/pytest_arraydiff.egg-info/SOURCES.txt index c85ff0a..26c124a 100644 --- a/pytest_arraydiff.egg-info/SOURCES.txt +++ b/pytest_arraydiff.egg-info/SOURCES.txt @@ -9,6 +9,7 @@ pytest_arraydiff.egg-info/PKG-INFO pytest_arraydiff.egg-info/SOURCES.txt pytest_arraydiff.egg-info/dependency_links.txt pytest_arraydiff.egg-info/entry_points.txt +pytest_arraydiff.egg-info/not-zip-safe pytest_arraydiff.egg-info/requires.txt pytest_arraydiff.egg-info/top_level.txt tests/test_pytest_arraydiff.py diff --git a/pytest_arraydiff.egg-info/not-zip-safe b/pytest_arraydiff.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pytest_arraydiff.egg-info/not-zip-safe @@ -0,0 +1 @@ + diff --git a/pytest_arraydiff/__init__.py b/pytest_arraydiff/__init__.py index b650ceb..cce384d 100755 --- a/pytest_arraydiff/__init__.py +++ b/pytest_arraydiff/__init__.py @@ -1 +1 @@ -__version__ = '0.2' +__version__ = '0.3' diff --git a/pytest_arraydiff/plugin.py b/pytest_arraydiff/plugin.py index 8bc4443..cd63b69 100755 --- a/pytest_arraydiff/plugin.py +++ b/pytest_arraydiff/plugin.py @@ -36,6 +36,7 @@ import abc import shutil import tempfile import warnings +from distutils.version import StrictVersion import six from six.moves.urllib.request import urlopen @@ -212,7 +213,10 @@ class ArrayComparison(object): def pytest_runtest_setup(self, item): - compare = item.keywords.get('array_compare') + if StrictVersion(pytest.__version__) < StrictVersion("3.6"): + compare = item.get_marker('array_compare') + else: + compare = item.get_closest_marker('array_compare') if compare is None: return @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 @@ -22,6 +22,7 @@ setup( author='Thomas Robitaille', author_email='thomas.robitaille@gmail.com', entry_points={'pytest11': ['pytest_arraydiff = pytest_arraydiff.plugin']}, + zip_safe=False, classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Pytest', |