diff options
author | Ole Streicher <olebole@debian.org> | 2023-11-27 12:18:58 +0100 |
---|---|---|
committer | Ole Streicher <olebole@debian.org> | 2023-11-27 12:18:58 +0100 |
commit | 0bb0095fc379a3e8306d51772fcf60258933b1c0 (patch) | |
tree | 332502e7c4e69095f809e738b4fb80aea35acea2 | |
parent | 27ea8b57c7b50fb6e63962ddd6f1afb11fbcf31c (diff) | |
parent | 718e80b6111f286d5a532830462bc309a2ab1fd8 (diff) |
Update upstream source from tag 'upstream/0.6.1'
Update to upstream version '0.6.1'
with Debian dir 27c3f264d8e0b78244b9188fde973c71ea09e8a6
-rw-r--r-- | CHANGES.md | 5 | ||||
-rw-r--r-- | PKG-INFO | 6 | ||||
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | pytest_arraydiff.egg-info/PKG-INFO | 6 | ||||
-rw-r--r-- | pytest_arraydiff.egg-info/SOURCES.txt | 1 | ||||
-rwxr-xr-x | pytest_arraydiff/plugin.py | 6 | ||||
-rw-r--r-- | pytest_arraydiff/version.py | 4 | ||||
-rw-r--r-- | tests/baseline/test_single_reference.fits | bin | 0 -> 5760 bytes | |||
-rw-r--r-- | tests/test_pytest_arraydiff.py | 22 | ||||
-rw-r--r-- | tox.ini | 3 |
10 files changed, 50 insertions, 7 deletions
@@ -1,3 +1,8 @@ +0.6.1 (2023-11-27) +------------------ + +- Fix broken ``single_reference=True`` usage. [#43] + 0.6 (2023-11-15) ---------------- @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest-arraydiff -Version: 0.6.0 +Version: 0.6.1 Summary: pytest plugin to help with comparing array output from tests Home-page: https://github.com/astropy/pytest-arraydiff Author: The Astropy Developers @@ -41,6 +41,10 @@ Requires-Dist: tables; extra == "test" :target: https://github.com/astropy/pytest-arraydiff/actions :alt: CI Status +.. image:: https://img.shields.io/pypi/v/pytest-arraydiff.svg + :target: https://pypi.org/project/pytest-arraydiff + :alt: PyPI Status + About ----- @@ -6,6 +6,10 @@ :target: https://github.com/astropy/pytest-arraydiff/actions :alt: CI Status +.. image:: https://img.shields.io/pypi/v/pytest-arraydiff.svg + :target: https://pypi.org/project/pytest-arraydiff + :alt: PyPI Status + About ----- diff --git a/pytest_arraydiff.egg-info/PKG-INFO b/pytest_arraydiff.egg-info/PKG-INFO index 096ef1a..ccb5858 100644 --- a/pytest_arraydiff.egg-info/PKG-INFO +++ b/pytest_arraydiff.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest-arraydiff -Version: 0.6.0 +Version: 0.6.1 Summary: pytest plugin to help with comparing array output from tests Home-page: https://github.com/astropy/pytest-arraydiff Author: The Astropy Developers @@ -41,6 +41,10 @@ Requires-Dist: tables; extra == "test" :target: https://github.com/astropy/pytest-arraydiff/actions :alt: CI Status +.. image:: https://img.shields.io/pypi/v/pytest-arraydiff.svg + :target: https://pypi.org/project/pytest-arraydiff + :alt: PyPI Status + About ----- diff --git a/pytest_arraydiff.egg-info/SOURCES.txt b/pytest_arraydiff.egg-info/SOURCES.txt index 0a7bebd..a16ff0b 100644 --- a/pytest_arraydiff.egg-info/SOURCES.txt +++ b/pytest_arraydiff.egg-info/SOURCES.txt @@ -21,6 +21,7 @@ pytest_arraydiff.egg-info/top_level.txt tests/test_pytest_arraydiff.py tests/baseline/test_absolute_tolerance.fits tests/baseline/test_relative_tolerance.fits +tests/baseline/test_single_reference.fits tests/baseline/test_succeeds_class.fits tests/baseline/test_succeeds_func_default.txt tests/baseline/test_succeeds_func_fits.fits diff --git a/pytest_arraydiff/plugin.py b/pytest_arraydiff/plugin.py index f476e68..825c9b6 100755 --- a/pytest_arraydiff/plugin.py +++ b/pytest_arraydiff/plugin.py @@ -310,8 +310,10 @@ class ArrayComparison(object): # Find test name to use as plot name filename = compare.kwargs.get('filename', None) if filename is None: - filename = item.name + '.' + extension - if not single_reference: + if single_reference: + filename = item.originalname + '.' + extension + else: + filename = item.name + '.' + extension filename = filename.replace('[', '_').replace(']', '_') filename = filename.replace('_.' + extension, '.' + extension) diff --git a/pytest_arraydiff/version.py b/pytest_arraydiff/version.py index 529d24f..7529f1e 100644 --- a/pytest_arraydiff/version.py +++ b/pytest_arraydiff/version.py @@ -12,5 +12,5 @@ __version__: str __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = '0.6.0' -__version_tuple__ = version_tuple = (0, 6, 0) +__version__ = version = '0.6.1' +__version_tuple__ = version_tuple = (0, 6, 1) diff --git a/tests/baseline/test_single_reference.fits b/tests/baseline/test_single_reference.fits Binary files differnew file mode 100644 index 0000000..9fab1ae --- /dev/null +++ b/tests/baseline/test_single_reference.fits diff --git a/tests/test_pytest_arraydiff.py b/tests/test_pytest_arraydiff.py index 5ad20dc..da603fa 100644 --- a/tests/test_pytest_arraydiff.py +++ b/tests/test_pytest_arraydiff.py @@ -152,5 +152,27 @@ def test_absolute_tolerance(): return np.ones((3, 4)) * 1.6 + 1.4 +@pytest.mark.array_compare( + reference_dir=reference_dir, + atol=1.5, + file_format='fits', + single_reference=True) +@pytest.mark.parametrize('spam', ('egg', 'bacon')) +def test_single_reference(spam): + return np.ones((3, 4)) * 1.6 + 1.4 + + +class TestSingleReferenceClass: + + @pytest.mark.array_compare( + reference_dir=reference_dir, + atol=1.5, + file_format='fits', + single_reference=True) + @pytest.mark.parametrize('spam', ('egg', 'bacon')) + def test_single_reference(self, spam): + return np.ones((3, 4)) * 1.6 + 1.4 + + def test_nofile(): pass @@ -10,7 +10,7 @@ isolated_build = true [testenv] changedir = .tmp/{envname} setenv = - devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple description = run tests deps = pytestoldest: pytest==4.6.0 @@ -28,6 +28,7 @@ deps = devdeps: git+https://github.com/pytest-dev/pytest#egg=pytest devdeps: numpy>=0.0.dev0 devdeps: pandas>=0.0.dev0 + devdeps: pyerfa>=0.0.dev0 devdeps: astropy>=0.0.dev0 extras = test |