%py3_test_envvars: Only set $PYTEST_XDIST_AUTO_NUM_WORKERS if not already set
This commit is contained in:
parent
d1c3ea93f8
commit
b2f798fc81
@ -169,7 +169,7 @@ print(_python_macro_cache[cache_key][name])
|
||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\
|
||||
PYTHONDONTWRITEBYTECODE=1\\\
|
||||
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\
|
||||
PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus}}
|
||||
PYTEST_XDIST_AUTO_NUM_WORKERS="${PYTEST_XDIST_AUTO_NUM_WORKERS:-%{_smp_build_ncpus}}"}
|
||||
|
||||
%python_disable_dependency_generator() \
|
||||
%undefine __pythondist_requires \
|
||||
|
@ -119,7 +119,7 @@
|
||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
|
||||
PYTHONDONTWRITEBYTECODE=1\\\
|
||||
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\
|
||||
PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus}}
|
||||
PYTEST_XDIST_AUTO_NUM_WORKERS="${PYTEST_XDIST_AUTO_NUM_WORKERS:-%{_smp_build_ncpus}}"}
|
||||
|
||||
# This is intended for Python 3 only, hence also no Python version in the name.
|
||||
%__pytest /usr/bin/pytest%(test %{python3_pkgversion} == 3 || echo -%{python3_version})
|
||||
|
@ -53,7 +53,7 @@ elseif posix.stat('macros.python-srpm') then
|
||||
end
|
||||
}
|
||||
Version: %{__default_python3_version}
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -163,6 +163,9 @@ grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* && exit 1 || true
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jan 25 2024 Miro Hrončok <mhroncok@redhat.com> - 3.12-7
|
||||
- %%py3_test_envvars: Only set $PYTEST_XDIST_AUTO_NUM_WORKERS if not already set
|
||||
|
||||
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
|
@ -324,7 +324,7 @@ def test_pytest_command_suffix_alternate_pkgversion(version):
|
||||
|
||||
def test_pytest_sets_pytest_xdist_auto_num_workers():
|
||||
lines = rpm_eval('%pytest', _smp_build_ncpus=2)
|
||||
assert 'PYTEST_XDIST_AUTO_NUM_WORKERS=2' in '\n'.join(lines)
|
||||
assert 'PYTEST_XDIST_AUTO_NUM_WORKERS="${PYTEST_XDIST_AUTO_NUM_WORKERS:-2}"' in '\n'.join(lines)
|
||||
|
||||
|
||||
def test_pytest_undefined_addopts_are_not_set():
|
||||
@ -374,7 +374,7 @@ def test_py3_test_envvars(lib, __pytest_addopts):
|
||||
assert 'PATH="BUILDROOT/usr/bin:$PATH"' in stripped_lines
|
||||
assert 'CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"' in stripped_lines
|
||||
assert 'PYTHONDONTWRITEBYTECODE=1' in stripped_lines
|
||||
assert 'PYTEST_XDIST_AUTO_NUM_WORKERS=3' in stripped_lines
|
||||
assert 'PYTEST_XDIST_AUTO_NUM_WORKERS="${PYTEST_XDIST_AUTO_NUM_WORKERS:-3}"' in stripped_lines
|
||||
if __pytest_addopts:
|
||||
assert f'PYTEST_ADDOPTS="${{PYTEST_ADDOPTS:-}} {__pytest_addopts}"' in stripped_lines
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user