Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Herbster0815
python-pyquery
make_webtest_optional.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File make_webtest_optional.patch of Package python-pyquery
--- tests/test_pyquery.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) Index: pyquery-2.0.0/tests/test_pyquery.py =================================================================== --- pyquery-2.0.0.orig/tests/test_pyquery.py +++ pyquery-2.0.0/tests/test_pyquery.py @@ -7,9 +7,12 @@ import time from lxml import etree from pyquery.pyquery import PyQuery as pq, no_default from pyquery.openers import HAS_REQUEST -from webtest import http -from webtest.debugapp import debug_app -from unittest import TestCase +from unittest import TestCase, skipIf +try: + from webtest import http + from webtest.debugapp import debug_app +except (ImportError, ModuleNotFoundError): + http = None sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) @@ -894,6 +897,7 @@ class TestXMLNamespace(TestCase): self.assertEqual(repr(val), repr('b')) +@skipIf(http is None, "Cannot test without WebTest") class TestWebScrapping(TestCase): def setUp(self): @@ -938,6 +942,7 @@ class TestWebScrappingEncoding(TestCase) self.assertEqual(d('#pt-login').text(), u'Войти') +@skipIf(http is None, "Cannot test without WebTest") class TestWebScrappingTimeouts(TestCase): def setUp(self): Index: pyquery-2.0.0/conftest.py =================================================================== --- pyquery-2.0.0.orig/conftest.py +++ pyquery-2.0.0/conftest.py @@ -1,7 +1,12 @@ import os import pytest -from webtest import http -from webtest.debugapp import debug_app + +try: + from webtest import http + from webtest.debugapp import debug_app +except (ImportError, ModuleNotFoundError): + http = None + from urllib.request import urlopen
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor