Skip to content

Commit 1256cf4

Browse files
authored
Merge pull request #1932 from seleniumbase/update-exception-handling
Update exception-handling and more
2 parents 8a528fb + 5a48d32 commit 1256cf4

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ chardet==5.1.0;python_version>="3.7"
3434
charset-normalizer==2.0.12;python_version<"3.7"
3535
charset-normalizer==3.1.0;python_version>="3.7"
3636
urllib3==1.26.12;python_version<"3.7"
37-
urllib3>=1.26.16,<2.1.0;python_version>="3.7"
37+
urllib3>=1.26.16,<2;python_version>="3.7" and python_version<"3.10"
38+
urllib3>=1.26.16,<2.1.0;python_version>="3.10"
3839
requests==2.27.1;python_version<"3.7"
3940
requests==2.31.0;python_version>="3.7"
4041
requests-toolbelt==1.0.0

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.15.6"
2+
__version__ = "4.15.7"

seleniumbase/core/mysql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class DatabaseManager:
77
def __init__(self, database_env="test", conf_creds=None):
88
"""Create a connection to the MySQL DB."""
99
import fasteners
10+
import sys
1011
import time
1112
from seleniumbase import config as sb_config
1213
from seleniumbase.config import settings
@@ -21,7 +22,10 @@ def __init__(self, database_env="test", conf_creds=None):
2122
try:
2223
import pymysql
2324
except Exception:
24-
shared_utils.pip_install("pymysql", version="1.0.2")
25+
if sys.version_info < (3, 7):
26+
shared_utils.pip_install("pymysql", version="1.0.2")
27+
else:
28+
shared_utils.pip_install("pymysql", version="1.1.0")
2529
import pymysql
2630
db_server = settings.DB_HOST
2731
db_port = settings.DB_PORT

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6360,13 +6360,13 @@ def assert_pdf_text(
63606360
)
63616361
if type(page) is int:
63626362
if text not in pdf_text:
6363-
raise Exception(
6363+
self.fail(
63646364
"PDF [%s] is missing expected text [%s] on "
63656365
"page [%s]!" % (pdf, text, page)
63666366
)
63676367
else:
63686368
if text not in pdf_text:
6369-
raise Exception(
6369+
self.fail(
63706370
"PDF [%s] is missing expected text [%s]!" % (pdf, text)
63716371
)
63726372
return True
@@ -7115,7 +7115,7 @@ def assert_no_js_errors(self, exclude=[]):
71157115
er_str = str(errors)
71167116
er_str = er_str.replace("[{", "[\n{").replace("}, {", "},\n{")
71177117
current_url = self.get_current_url()
7118-
raise Exception(
7118+
self.fail(
71197119
"JavaScript errors found on %s => %s" % (current_url, er_str)
71207120
)
71217121
if self.demo_mode:
@@ -7670,7 +7670,7 @@ def reset_default_timeout(self):
76707670

76717671
def fail(self, msg="fail() called!"):
76727672
"""Fail immediately, with the given message."""
7673-
raise self.failureException(msg)
7673+
super().fail(msg)
76747674

76757675
def skip(self, reason=""):
76767676
"""Mark the test as Skipped."""

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@
160160
'charset-normalizer==2.0.12;python_version<"3.7"',
161161
'charset-normalizer==3.1.0;python_version>="3.7"',
162162
'urllib3==1.26.12;python_version<"3.7"',
163-
'urllib3>=1.26.16,<2.1.0;python_version>="3.7"',
163+
'urllib3>=1.26.16,<2;python_version>="3.7" and python_version<"3.10"', # noqa: E501
164+
'urllib3>=1.26.16,<2.1.0;python_version>="3.10"',
164165
'requests==2.27.1;python_version<"3.7"',
165166
'requests==2.31.0;python_version>="3.7"',
166167
'requests-toolbelt==1.0.0',

0 commit comments

Comments
 (0)