2024-11-16 08:48:37 +00:00
|
|
|
diff -Nru pyquery-2.0.1.orig/conftest.py pyquery-2.0.1/conftest.py
|
|
|
|
--- pyquery-2.0.1.orig/conftest.py 2024-08-30 10:12:19.000000000 +0200
|
|
|
|
+++ pyquery-2.0.1/conftest.py 2024-11-15 14:36:47.617602776 +0100
|
|
|
|
@@ -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
|
|
|
|
|
|
|
|
|
|
|
|
diff -Nru pyquery-2.0.1.orig/tests/test_pyquery.py pyquery-2.0.1/tests/test_pyquery.py
|
|
|
|
--- pyquery-2.0.1.orig/tests/test_pyquery.py 2024-08-30 10:12:19.000000000 +0200
|
|
|
|
+++ pyquery-2.0.1/tests/test_pyquery.py 2024-11-15 14:36:47.607602471 +0100
|
|
|
|
@@ -7,9 +7,12 @@
|
2023-02-17 16:55:02 +00:00
|
|
|
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__)))
|
|
|
|
|
2024-11-16 08:48:37 +00:00
|
|
|
@@ -888,6 +891,7 @@
|
2023-02-17 16:55:02 +00:00
|
|
|
self.assertEqual(repr(val), repr('b'))
|
|
|
|
|
|
|
|
|
|
|
|
+@skipIf(http is None, "Cannot test without WebTest")
|
|
|
|
class TestWebScrapping(TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
2024-11-16 08:48:37 +00:00
|
|
|
@@ -932,6 +936,7 @@
|
|
|
|
self.assertEqual(d('#pt-login').text(), 'Войти')
|
2023-02-17 16:55:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
+@skipIf(http is None, "Cannot test without WebTest")
|
|
|
|
class TestWebScrappingTimeouts(TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|