Blob Blame History Raw
Name:           python-parameterized
Version:        0.9.0
Release:        %autorelease
Summary:        Parameterized testing with any Python test framework

License:        BSD-2-Clause-Views
# CHANGELOG.txt is no longer included in the PyPI sdist
# Source:         %%{pypi_source parameterized}
Source:         %{url}/archive/v%{version}/parameterized-%{version}.tar.gz

# Remove the usage of assertRaisesRegexp unit test alias removed in Python 3.12

BuildArch:      noarch

BuildRequires:  python3-devel

# Upstream supports tox, and in theory we could generate these by something like:
#   %%pyproject_buildrequires -t -e %%{toxenv}-nose2,%%{toxenv}-pytest4,%%{toxenv}-unit
# but upstream is not keeping up, and we would also have to patch in support
# for environments after py311. It’s not worth it; we can more easily run the
# tests manually and specify the BR’s manually. See %%check.
BuildRequires:  python3dist(nose2)
BuildRequires:  python3dist(pytest)


%package -n python3-parameterized
Summary:        %{summary}

%description -n python3-parameterized

%autosetup -p1 -n parameterized-%{version}
sed -r -i 's/^import mock/from unittest import mock/' parameterized/
# Workaround for:
#   Support pytest7
sed -r -i 's/assert_equal\(missing/# &/' parameterized/



%pyproject_save_files parameterized

export PYTHONPATH=%{buildroot}%{python3_sitelib}
%{python3} -m nose2 -v
%pytest parameterized/
%{python3} -m unittest -v parameterized.test

%files -n python3-parameterized -f %{pyproject_files}
# pyproject_files handles LICENSE.txt; verify with “rpm -qL -p …”