From c7619ab713d9d802a4b4f07c1326d918cf8afbb03f6235494d724f13989aca6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 1 Feb 2019 10:35:41 +0000 Subject: [PATCH] - Make sure to skip tests that need network access OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gevent?expand=0&rev=49 --- python-gevent.changes | 5 +++++ python-gevent.spec | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/python-gevent.changes b/python-gevent.changes index 437c9de..979e4eb 100644 --- a/python-gevent.changes +++ b/python-gevent.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 1 10:35:13 UTC 2019 - Tomáš Chvátal + +- Make sure to skip tests that need network access + ------------------------------------------------------------------- Thu Jan 31 09:42:44 UTC 2019 - Tomáš Chvátal diff --git a/python-gevent.spec b/python-gevent.spec index a211612..b6a243a 100644 --- a/python-gevent.spec +++ b/python-gevent.spec @@ -28,21 +28,32 @@ Source: https://files.pythonhosted.org/packages/source/g/gevent/gevent-% Source100: %{name}-rpmlintrc BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} +BuildRequires: %{python_module dnspython} BuildRequires: %{python_module greenlet >= 0.4.14} BuildRequires: %{python_module mock} BuildRequires: %{python_module objgraph} +BuildRequires: %{python_module requests} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module zope.event} +BuildRequires: %{python_module zope.interface} +# /etc/protocols needed for tests BuildRequires: c-ares-devel BuildRequires: fdupes BuildRequires: libev-devel +BuildRequires: libuv-devel +BuildRequires: netcfg BuildRequires: python-rpm-macros BuildRequires: python3-testsuite Requires: python-cffi +Requires: python-dnspython Requires: python-greenlet +Requires: python-requests %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel} >= 8 Recommends: python-psutil +Recommends: python-zope.event %else Requires: python-psutil +Requires: python-zope.event %endif %python_subpackages @@ -88,9 +99,18 @@ export GEVENT_NO_CFFI_BUILD=1 %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -# tests passed as 20 need network connection with no way to skip +# create ignore list of tests that reach out to the net +cat <<'EOF' >> network_tests.txt +test_urllib2net.py +test__server.py +test__server_pywsgi.py +test__socket_ssl.py +test___example_servers.py +test__socket_dns.py +test__getaddrinfo_import.py +EOF export GEVENT_RESOLVER=thread -%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m gevent.tests || : +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m gevent.tests --ignore network_tests.txt %files %{python_files} %doc AUTHORS README.rst TODO CHANGES.rst CONTRIBUTING.rst