From f3b44339dbae27138779d86fa624ff9c8282a53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 22 Nov 2018 17:34:07 +0100 Subject: [PATCH] Enable most of the tests in %check --- python-pip.spec | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index cf4b6af..63490df 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,5 +1,5 @@ %bcond_with bootstrap -%bcond_with tests +%bcond_without tests %bcond_without python2 %bcond_without doc @@ -60,8 +60,9 @@ Source0: %pypi_source BuildArch: noarch %if %{with tests} -BuildRequires: git -BuildRequires: bzr +BuildRequires: /usr/bin/git +BuildRequires: /usr/bin/bzr +BuildRequires: /usr/bin/svn %endif # to get tests: @@ -387,10 +388,24 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %if %{with tests} %check export PYTHONPATH=src + +mkdir _bin +export PATH="$PWD/_bin:$PATH" + + +# bash completion tests only work from installed package +# test_yaml_based, test_uninstall_non_local_distutils, test_venv_modification, test_freeze_git_clone_srcdir are failing TODO investigate +# other deselected tests download setuptools and wheel from the interwebs and are not marked as network +%global pytest_k 'not completion and not test_pep518 and not test_install_with_target_and_scripts_no_warning and not test_install_incompatible_python_requires and not test_install_compatible_python_requires and not test_wheel_exit_status_code_when_no_requirements and not test_wheel_exit_status_code_when_blank_requirements_file and not test_constraints_local_editable_install_pep518 and not test_constraints_local_editable_install_pep518 and not test_wheel_exit_status_code_when_blank_requirements_file and not test_yaml_based and not test_uninstall_non_local_distutils and not test_venv_modification and not test_freeze_git_clone_srcdir and not test_upgrade_argparse_shadowed' + %if %{with python2} -%{__python2} -m pytest -m 'not network' +ln -s %{buildroot}%{_bindir}/pip2 _bin/pip +%{__python2} -m pytest -m 'not network' -k %{pytest_k} %endif -%{__python3} -m pytest -m 'not network' + + +ln -sf %{buildroot}%{_bindir}/pip3 _bin/pip +%{__python3} -m pytest -m 'not network' -k %{pytest_k} %endif