From c5ffca7712064d9c237a1624032551dece76a2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 12 Jul 2019 15:45:09 +0200 Subject: [PATCH] Add %check, but keep it bconded out for now --- python-virtualenv.spec | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 6f5dea5..6346882 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -30,6 +30,19 @@ BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-towncrier %endif +# we don't have all the dependencies +# some tests also need internet connection +%bcond_with tests +%if %{with tests} +BuildRequires: python3-pytest +BuildRequires: python3-pytest-xdist +BuildRequires: csh +BuildRequires: fish +#BuildRequires: xonsh -- the xonsh tests are failing :( +#BuildRequires: python3-pypiserver -- not available yet +#BuildRequires: python3-pytest-localserver -- not available yet +%endif + # RPM installed wheels BuildRequires: python-pip-wheel BuildRequires: python-setuptools-wheel @@ -122,6 +135,22 @@ rm %{buildroot}/%{_bindir}/virtualenv %{py3_install} +%if %{with tests} +%check +mkdir tmp_path +ln -s $(realpath %{__python3}) tmp_path/python +export PATH="$(pwd)/tmp_path:$PATH" +export PYTHONPATH="$(pwd)" +unset SOURCE_DATE_EPOCH +cp -p /usr/share/python-wheels/*.whl virtualenv_support + +# test_missing_certifi_pem patches bundled pip wheel, but ours is patched already +# test_always_copy_option https://github.com/pypa/virtualenv/issues/1332 +python -m pytest -vv -n auto -k "not test_missing_certifi_pem and not test_always_copy_option" + +rm virtualenv_support/*.whl +rm -r tmp_path +%endif %files -n python2-virtualenv %license LICENSE.txt