75bd93d
Name:           python-parameterized
ef3e907
Version:        0.9.0
2e3f31c
Release:        %autorelease
Igor Gnatenko 50b0ff9
Summary:        Parameterized testing with any Python test framework
Igor Gnatenko 50b0ff9
ed5d6dd
License:        BSD-2-Clause-Views
7b60ad2
URL:            https://github.com/wolever/parameterized
ef3e907
# CHANGELOG.txt is no longer included in the PyPI sdist
ef3e907
# https://github.com/wolever/parameterized/issues/168
ef3e907
# Source:         %%{pypi_source parameterized}
ef3e907
Source:         %{url}/archive/v%{version}/parameterized-%{version}.tar.gz
f28c3ee
95cecfe
# Remove the usage of assertRaisesRegexp unit test alias removed in Python 3.12
95cecfe
Patch:          https://github.com/wolever/parameterized/pull/169.patch
95cecfe
d9520e6
# Fix tests to handle Python 3.13 stripping indents from docstrings
d9520e6
Patch:          https://github.com/wolever/parameterized/pull/176.patch
d9520e6
Igor Gnatenko 50b0ff9
BuildArch:      noarch
Igor Gnatenko 50b0ff9
0e9d7ba
BuildRequires:  python3-devel
0e9d7ba
0e9d7ba
# Upstream supports tox, and in theory we could generate these by something like:
0e9d7ba
#   %%pyproject_buildrequires -t -e %%{toxenv}-nose2,%%{toxenv}-pytest4,%%{toxenv}-unit
0e9d7ba
# but upstream is not keeping up, and we would also have to patch in support
ef3e907
# for environments after py311. It’s not worth it; we can more easily run the
0e9d7ba
# tests manually and specify the BR’s manually. See %%check.
0e9d7ba
BuildRequires:  python3dist(nose2)
0e9d7ba
BuildRequires:  python3dist(pytest)
0e9d7ba
Igor Gnatenko 50b0ff9
%description
Igor Gnatenko 50b0ff9
%{summary}.
Igor Gnatenko 50b0ff9
0e9d7ba
75bd93d
%package -n python3-parameterized
Igor Gnatenko 50b0ff9
Summary:        %{summary}
Igor Gnatenko 50b0ff9
75bd93d
%description -n python3-parameterized
Igor Gnatenko 50b0ff9
%{summary}.
Igor Gnatenko 50b0ff9
0e9d7ba
Igor Gnatenko 50b0ff9
%prep
75bd93d
%autosetup -p1 -n parameterized-%{version}
ef3e907
sed -r -i 's/^import mock/from unittest import mock/' parameterized/test.py
ef3e907
# Workaround for:
ef3e907
#   Support pytest7
ef3e907
#   https://github.com/wolever/parameterized/issues/167
ef3e907
sed -r -i 's/assert_equal\(missing/# &/' parameterized/test.py
Igor Gnatenko 50b0ff9
0e9d7ba
0e9d7ba
%generate_buildrequires
0e9d7ba
%pyproject_buildrequires
0e9d7ba
0e9d7ba
Igor Gnatenko 50b0ff9
%build
0e9d7ba
%pyproject_wheel
0e9d7ba
Igor Gnatenko 50b0ff9
Igor Gnatenko 50b0ff9
%install
0e9d7ba
%pyproject_install
0e9d7ba
%pyproject_save_files parameterized
0e9d7ba
Igor Gnatenko 50b0ff9
a8ab733
%check
f19e55c
%{py3_test_envvars} %{python3} -m nose2 -v
aaf27ee
%pytest parameterized/test.py
f19e55c
%{py3_test_envvars} %{python3} -m unittest -v parameterized.test
Igor Gnatenko 50b0ff9
0e9d7ba
0e9d7ba
%files -n python3-parameterized -f %{pyproject_files}
0e9d7ba
# pyproject_files handles LICENSE.txt; verify with “rpm -qL -p …”
Igor Gnatenko 50b0ff9
%doc CHANGELOG.txt README.rst
0e9d7ba
Igor Gnatenko 50b0ff9
Igor Gnatenko 50b0ff9
%changelog
2e3f31c
%autochangelog