Use versioned pytest executable in `%pytest` macro for non-main Python stack

This commit is contained in:
Lumir Balhar 2020-09-07 12:35:33 +02:00
parent 431e4380cc
commit 0253654076
2 changed files with 8 additions and 1 deletions

View File

@ -73,7 +73,7 @@
}
# This is intended for Python 3 only, hence also no Python version in the name.
%__pytest /usr/bin/pytest
%__pytest /usr/bin/pytest%(test %{python3_pkgversion} == 3 || echo -%{python3_version})
%pytest %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\

View File

@ -188,6 +188,13 @@ def test_pytest_different_command():
assert 'pytest-3' in lines[-1]
def test_pytest_command_suffix():
lines = rpm_eval('%pytest -v')
assert '/usr/bin/pytest -v' in lines[-1]
lines = rpm_eval('%pytest -v', python3_pkgversion="3.6", python3_version="3.6")
assert '/usr/bin/pytest-3.6 -v' in lines[-1]
def test_pypi_source_default_name():
url = rpm_eval('%pypi_source',
name='foo', version='6')[0]