Backport %check section from master
This commit is contained in:
parent
19c55ef01a
commit
559695054a
1 changed files with 22 additions and 1 deletions
|
|
@ -68,6 +68,8 @@ Obsoletes: python2-tox < 2.9.1-4
|
|||
# for tests
|
||||
BuildRequires: python3-py
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: python3-pytest-mock
|
||||
BuildRequires: python3-pytest-xdist
|
||||
BuildRequires: python3-virtualenv
|
||||
%endif
|
||||
|
||||
|
|
@ -100,7 +102,26 @@ rm -rf %{pypiname}.egg-info
|
|||
# if internet connection available, run tests
|
||||
%if %{with internet}
|
||||
%check
|
||||
TOXENV=py%{python3_version_nodots} %{__python3} setup.py test
|
||||
# there will be failures like
|
||||
# ModuleNotFoundError: tox
|
||||
# or InterpreterNotFound: python
|
||||
# We juggle the environment variables as much as we can, but it's not perfect.
|
||||
# To workaround this:
|
||||
# 1. build --without internet
|
||||
# 2. install the new python3-tox
|
||||
# 3. build --with internet
|
||||
mkdir .path
|
||||
ln -s %{__python3} .path/python
|
||||
ln -s /usr/bin/easy_install-%{python3_version} .path/easy_install
|
||||
ln -s /usr/bin/pytest-%{python3_version} .path/pytest
|
||||
ln -s /usr/bin/pip3 .path/pip
|
||||
export PATH=$(pwd)/.path:%{buildroot}%{_bindir}:$PATH
|
||||
export PYTHONPATH=%{buildroot}%{python3_sitelib}
|
||||
export TOXENV=py%{python3_version_nodots}
|
||||
export TOX_TESTENV_PASSENV="PATH TOX_TESTENV_PASSENV"
|
||||
# TODO figure out why PEP517/518 tests and test_provision_cli_args_ignore won't pass
|
||||
pytest-3 -n auto -k "not test_verbose_isolated_build and not test_dist_exists_version_change and not test_alwayscopy"
|
||||
rm -rf .path
|
||||
%endif
|
||||
|
||||
%files -n python3-%{pypiname}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue