diff --git a/np_num-deprecated.patch b/np_num-deprecated.patch deleted file mode 100644 index 4333a8c..0000000 --- a/np_num-deprecated.patch +++ /dev/null @@ -1,97 +0,0 @@ ---- - src/pytest_regressions/dataframe_regression.py | 4 ++-- - tests/test_dataframe_regression.py | 8 ++++---- - tests/test_num_regression.py | 10 +++++----- - 3 files changed, 11 insertions(+), 11 deletions(-) - ---- a/src/pytest_regressions/dataframe_regression.py -+++ b/src/pytest_regressions/dataframe_regression.py -@@ -123,7 +123,7 @@ class DataFrameRegressionFixture: - self._check_data_shapes(obtained_column, expected_column) - - data_type = obtained_column.values.dtype -- if data_type in [float, np.float, np.float16, np.float32, np.float64]: -+ if data_type in [float, np.float16, np.float32, np.float64]: - not_close_mask = ~np.isclose( - obtained_column.values, - expected_column.values, -@@ -137,7 +137,7 @@ class DataFrameRegressionFixture: - diff_ids = np.where(not_close_mask)[0] - diff_obtained_data = obtained_column[diff_ids] - diff_expected_data = expected_column[diff_ids] -- if data_type == np.bool: -+ if data_type == bool: - diffs = np.logical_xor(obtained_column, expected_column)[diff_ids] - else: - diffs = np.abs(obtained_column - expected_column)[diff_ids] ---- a/tests/test_dataframe_regression.py -+++ b/tests/test_dataframe_regression.py -@@ -193,7 +193,7 @@ def test_arrays_with_different_sizes(dat - - - def test_integer_values_smoke_test(dataframe_regression, no_regen): -- data1 = np.ones(11, dtype=np.int) -+ data1 = np.ones(11, dtype=int) - dataframe_regression.check(pd.DataFrame.from_dict({"data1": data1})) - - -@@ -203,7 +203,7 @@ def test_number_formats(dataframe_regres - - - def test_bool_array(dataframe_regression, no_regen): -- data1 = np.array([True, True, True], dtype=np.bool) -+ data1 = np.array([True, True, True], dtype=bool) - with pytest.raises(AssertionError) as excinfo: - dataframe_regression.check(pd.DataFrame.from_dict({"data1": data1})) - obtained_error_msg = str(excinfo.value) -@@ -228,8 +228,8 @@ def test_bool_array(dataframe_regression - - def test_arrays_of_same_size(dataframe_regression): - same_size_int_arrays = { -- "hello": np.zeros((1,), dtype=np.int), -- "world": np.zeros((1,), dtype=np.int), -+ "hello": np.zeros((1,), dtype=int), -+ "world": np.zeros((1,), dtype=int), - } - dataframe_regression.check(pd.DataFrame.from_dict(same_size_int_arrays)) - ---- a/tests/test_num_regression.py -+++ b/tests/test_num_regression.py -@@ -169,7 +169,7 @@ def test_different_data_types(num_regres - - - def test_n_dimensions(num_regression, no_regen): -- data1 = np.ones(shape=(10, 10), dtype=np.int) -+ data1 = np.ones(shape=(10, 10), dtype=int) - with pytest.raises( - AssertionError, - match="Only 1D arrays are supported on num_data_regression fixture.", -@@ -186,7 +186,7 @@ def test_arrays_with_different_sizes(num - - - def test_integer_values_smoke_test(num_regression, no_regen): -- data1 = np.ones(11, dtype=np.int) -+ data1 = np.ones(11, dtype=int) - num_regression.check({"data1": data1}) - - -@@ -228,7 +228,7 @@ def test_fill_different_shape_with_nan_f - - - def test_bool_array(num_regression, no_regen): -- data1 = np.array([True, True, True], dtype=np.bool) -+ data1 = np.array([True, True, True], dtype=bool) - with pytest.raises(AssertionError) as excinfo: - num_regression.check({"data1": data1}) - obtained_error_msg = str(excinfo.value) -@@ -253,8 +253,8 @@ def test_bool_array(num_regression, no_r - - def test_arrays_of_same_size(num_regression): - same_size_int_arrays = { -- "hello": np.zeros((1,), dtype=np.int), -- "world": np.zeros((1,), dtype=np.int), -+ "hello": np.zeros((1,), dtype=int), -+ "world": np.zeros((1,), dtype=int), - } - num_regression.check(same_size_int_arrays) - diff --git a/pytest-regressions-2.2.0.tar.gz b/pytest-regressions-2.2.0.tar.gz deleted file mode 100644 index a0061f5..0000000 --- a/pytest-regressions-2.2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15a71f77cb266dd4ca94331abe4c339ad056b2b2175e47442711c98cf6d65716 -size 98162 diff --git a/pytest-regressions-2.4.2.tar.gz b/pytest-regressions-2.4.2.tar.gz new file mode 100644 index 0000000..f9df37e --- /dev/null +++ b/pytest-regressions-2.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eab89e7ba4aa339bdfe07b31047e8e6a70b1e7846e74a8bbfc31a588d01e7303 +size 111030 diff --git a/python-pytest-regressions.changes b/python-pytest-regressions.changes index 69bc399..1fc8e6f 100644 --- a/python-pytest-regressions.changes +++ b/python-pytest-regressions.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Tue May 9 21:07:08 UTC 2023 - Dirk Müller + +- update to 2.4.2: + * Properly handle missing index ``0``. + * Compatibility fix for pytest 6.2. + * New ``--regen-all`` flag, which regenerates all files without + failing the tests. Useful to regenerate all files in + the test suite with a single run. + * The public API is now fully type annotated. + * ``pytest>=6.2`` is now required. + * Properly handle empty and NaN values on + num_regression and dataframe_regression. + * New ``--with-test-class-names`` command-line flag to consider + test class names when composing the expected and obtained + data filenames. Needed when the same module contains + different classes with the same method names. + * New ``ndarrays_regression``, for comparing NumPy arrays with + arbitrary shape. + * Fix ``empty string bug`` on dataframe regression. +- drop np_num-deprecated.patch (upstream) + ------------------------------------------------------------------- Fri May 5 19:54:00 UTC 2023 - Johannes Kastl diff --git a/python-pytest-regressions.spec b/python-pytest-regressions.spec index cd96c7c..6a00aa0 100644 --- a/python-pytest-regressions.spec +++ b/python-pytest-regressions.spec @@ -18,21 +18,18 @@ %{?sle15_python_module_pythons} Name: python-pytest-regressions -Version: 2.2.0 +Version: 2.4.2 Release: 0 License: MIT Summary: Python fixtures to write regression tests URL: https://github.com/ESSS/pytest-regressions Group: Development/Languages/Python Source: https://files.pythonhosted.org/packages/source/p/pytest-regressions/pytest-regressions-%{version}.tar.gz -# PATCH-FIX-UPSTREAM np_num-deprecated.patch gh#ESSS/pytest-regressions#63 mcepl@suse.com -# don't use deprecated np.* types -Patch0: np_num-deprecated.patch BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros # SECTION test requirements -BuildRequires: %{python_module pytest >= 3.5.0} +BuildRequires: %{python_module pytest >= 6.2.0} BuildRequires: %{python_module Pillow} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module matplotlib} @@ -42,7 +39,7 @@ BuildRequires: %{python_module pytest-datadir >= 1.2.0} # /SECTION BuildRequires: fdupes Requires: python-PyYAML -Requires: python-pytest >= 3.5.0 +Requires: python-pytest >= 6.2.0 Requires: python-pytest-datadir >= 1.2.0 Suggests: python-matplotlib Suggests: python-numpy