Set PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} from %pytest
pytest-xdist 3+ respects this value when -n auto is used. See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/FQUUM3SZLRY3UUQJ355H4IJS2GRGIEVI/
This commit is contained in:
parent
bb334db9f3
commit
86c391c493
@ -113,4 +113,5 @@
|
|||||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
|
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
|
||||||
PYTHONDONTWRITEBYTECODE=1\\\
|
PYTHONDONTWRITEBYTECODE=1\\\
|
||||||
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\
|
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\
|
||||||
|
PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus}\\\
|
||||||
%__pytest}
|
%__pytest}
|
||||||
|
@ -52,7 +52,7 @@ elseif posix.stat('macros.python-srpm') then
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
Version: %{__default_python3_version}
|
Version: %{__default_python3_version}
|
||||||
Release: 5%{?dist}
|
Release: 6%{?dist}
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -159,6 +159,10 @@ grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* && exit 1 || true
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Nov 13 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11-6
|
||||||
|
- Set PYTEST_XDIST_AUTO_NUM_WORKERS=%%{_smp_build_ncpus} from %%pytest
|
||||||
|
- pytest-xdist 3+ respects this value when -n auto is used
|
||||||
|
|
||||||
* Tue Oct 25 2022 Lumír Balhar <lbalhar@redhat.com> - 3.11-5
|
* Tue Oct 25 2022 Lumír Balhar <lbalhar@redhat.com> - 3.11-5
|
||||||
- Include pathfix.py in this package
|
- Include pathfix.py in this package
|
||||||
|
|
||||||
|
@ -319,6 +319,11 @@ def test_pytest_command_suffix_alternate_pkgversion(version):
|
|||||||
assert f'/usr/bin/pytest-{version} -v' in lines[-1]
|
assert f'/usr/bin/pytest-{version} -v' in lines[-1]
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
def test_pytest_undefined_addopts_are_not_set():
|
def test_pytest_undefined_addopts_are_not_set():
|
||||||
lines = rpm_eval('%pytest', __pytest_addopts=None)
|
lines = rpm_eval('%pytest', __pytest_addopts=None)
|
||||||
assert 'PYTEST_ADDOPTS' not in '\n'.join(lines)
|
assert 'PYTEST_ADDOPTS' not in '\n'.join(lines)
|
||||||
|
Loading…
Reference in New Issue
Block a user