On 27. 04. 20 11:34, Miro Hrončok wrote:
Hello Python packagers,
since there is no upstream supported universal test invocation for Python (`python setup.py test` is deprecated and the de-facto-standard `tox` doesn't always do what we want in RPM's %check and/or is not always used by upstreams) and a lot of upstreams use pytest, I'd like to propose a %pytest macros, for standardizing the way pytest is run.
Usage:
%check %pytest
Or with options passed to pyets:
%check %pytest -v -m "not network" tests/
(Here ends the tl;dr version.)
Why not just use `pytest` or `%{python3} -m pytest` instead of `%pytest`?
We want to *test the code we ship*. In the general case this involves:
1. Prepending sys.path with %{buildroot}%{python3_sitelib} (and/or sitearch) 2. Prepending $PATH with %{buildroot}%{_bindir} 3. Ensuring $PWD is not in sys.path
So the idea is...
https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/55