From f2f7e4abd645f614871317c2644759f477599519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 7 Dec 2022 22:27:24 +0100 Subject: [PATCH] Run tests during the package build --- python-tox-current-env.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python-tox-current-env.spec b/python-tox-current-env.spec index 9383f59..c8edb91 100644 --- a/python-tox-current-env.spec +++ b/python-tox-current-env.spec @@ -3,7 +3,7 @@ Name: python-%{pypi_name} Version: 0.0.8 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tox plugin to run tests in current Python environment License: MIT @@ -14,6 +14,13 @@ BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros +# test dependencies extracted from tox.ini +# TODO use [tests] extra with the next release +# https://github.com/fedora-python/tox-current-env/pull/53 +BuildRequires: python%{python3_pkgversion}-packaging +BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-pytest-xdist + %description The tox-current-env plugin allows to run tests in current Python environment. @@ -45,11 +52,11 @@ The tox-current-env plugin allows to run tests in current Python environment. %check -# the tests currently only work within actual tox and with various Python -# versions installed, so we skip them and do an import check only instead. # hooks[34].py are imported in hooks.py based on tox version so we have to # exclude them here. %pyproject_check_import -e '*.hooks?' +# deselected tests run tox without the options for this plugin and hence they need internet +%pytest -k "not regular and not noquiet_installed_packages[None]" %files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} @@ -57,6 +64,9 @@ The tox-current-env plugin allows to run tests in current Python environment. %changelog +* Wed Dec 07 2022 Miro HronĨok - 0.0.8-4 +- Run tests during the package build + * Fri Jul 22 2022 Fedora Release Engineering - 0.0.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild