From dfc77745f71d7b3f786e79a94bfb7dc1b8e61730 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Sep 09 2021 08:39:01 +0000 Subject: Import python-pytest-mpl-0.12-2.el9 in CloudSIG xena --- diff --git a/.python-pytest-mpl.metadata b/.python-pytest-mpl.metadata new file mode 100644 index 0000000..f3e30af --- /dev/null +++ b/.python-pytest-mpl.metadata @@ -0,0 +1,2 @@ +e1ea3192411baaa789b29ce1a2f38965bc132ab4 SOURCES/pytest-mpl-0.12.tar.gz +79478cd8d3494b15c185bf912ec58b632cab4017 SOURCES/test_hash_lib.json diff --git a/SOURCES/0001-Increase-tolerance-for-new-FreeType.patch b/SOURCES/0001-Increase-tolerance-for-new-FreeType.patch new file mode 100644 index 0000000..de81b5d --- /dev/null +++ b/SOURCES/0001-Increase-tolerance-for-new-FreeType.patch @@ -0,0 +1,53 @@ +From cb75688d5cbdcecbca550d6661e4734a7121854f Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Mon, 16 Jul 2018 00:52:13 -0400 +Subject: [PATCH] Increase tolerance for new FreeType. + +Signed-off-by: Elliott Sales de Andrade +--- + tests/test_pytest_mpl.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_pytest_mpl.py b/tests/test_pytest_mpl.py +index 146bc0a..1dc7bc1 100644 +--- a/tests/test_pytest_mpl.py ++++ b/tests/test_pytest_mpl.py +@@ -54,7 +54,7 @@ def assert_pytest_fails_with(args, output_substring): + + + @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local, +- tolerance=DEFAULT_TOLERANCE) ++ tolerance=7.1) + def test_succeeds(): + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) +@@ -86,7 +86,7 @@ def test_succeeds_faulty_mirror(): + class TestClass(object): + + @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local, +- tolerance=DEFAULT_TOLERANCE) ++ tolerance=7.1) + def test_succeeds(self): + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) +@@ -213,7 +213,7 @@ def test_nofigure(): + + @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local, + style='fivethirtyeight', +- tolerance=DEFAULT_TOLERANCE) ++ tolerance=7.5) + def test_base_style(): + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) +@@ -249,7 +249,7 @@ class TestClassWithSetup: + + @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local, + filename='test_succeeds.png', +- tolerance=DEFAULT_TOLERANCE) ++ tolerance=7.1) + def test_succeeds(self): + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) +-- +2.26.2 + diff --git a/SPECS/python-pytest-mpl.spec b/SPECS/python-pytest-mpl.spec new file mode 100644 index 0000000..0924230 --- /dev/null +++ b/SPECS/python-pytest-mpl.spec @@ -0,0 +1,108 @@ +%global srcname pytest-mpl + +Name: python-%{srcname} +Version: 0.12 +Release: 2%{?dist} +Summary: Pytest plugin for testing figure output from Matplotlib + +License: BSD +URL: https://github.com/matplotlib/pytest-mpl +Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz +# Missing file: https://github.com/matplotlib/pytest-mpl/pull/109 +Source1: https://github.com/matplotlib/pytest-mpl/raw/01c5ec39caa5001d700c7819628b57c798f1e2bb/tests/baseline/test_hash_lib.json +# Probably not going upstream. +Patch0001: 0001-Increase-tolerance-for-new-FreeType.patch + +BuildArch: noarch + +%global _description \ +This is a plugin to facilitate image comparison for Matplotlib figures in \ +pytest. Matplotlib includes a number of test utilities and decorators, but \ +these are geared towards the nose testing framework. Pytest-mpl makes it easy \ +to compare figures produced by tests to reference images when using pytest. + +%description %{_description} + + +%package -n python3-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{srcname}} + +BuildRequires: python3-devel +BuildRequires: python3dist(matplotlib) +BuildRequires: python3dist(nose) +BuildRequires: python3dist(pillow) +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(setuptools) + +%description -n python3-%{srcname} %{_description} + + +%prep +%autosetup -n %{srcname}-%{version} -p1 +cp %SOURCE1 tests/baseline/ + +# Remove bundled egg-info +rm -rf %{srcname}.egg-info + + +%build +%py3_build + + +%install +%py3_install + + +%check +# Skip networked tests. +MPLBACKEND=Agg %{pytest} --mpl tests -k 'not test_succeeds_remote and not test_succeeds_faulty_mirror' +MPLBACKEND=Agg %{pytest} tests -k 'not test_succeeds_remote and not test_succeeds_faulty_mirror' + + +%files -n python3-%{srcname} +%license LICENSE +%doc README.rst +%{python3_sitelib}/pytest_mpl +%{python3_sitelib}/pytest_mpl-%{version}-py%{python3_version}.egg-info + + +%changelog +* Wed Jan 27 2021 Fedora Release Engineering - 0.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sun Dec 13 2020 Elliott Sales de Andrade - 0.12-1 +- Update to latest version (#1894886) + +* Wed Jul 29 2020 Fedora Release Engineering - 0.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 0.11-3 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 15 2019 Elliott Sales de Andrade - 0.11-1 +- Update to latest version + +* Thu Oct 03 2019 Miro Hrončok - 0.10-5 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 0.10-4 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 0.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Oct 19 2018 Elliott Sales de Andrade - 0.10-1 +- Update to latest version + +* Wed Jul 18 2018 Elliott Sales de Andrade - 0.9-2 +- Remove unnecessary cache files + +* Mon Jul 16 2018 Elliott Sales de Andrade - 0.9-1 +- Initial package.