Skip to content

Commit a567251

Browse files
authored
Merge pull request #900 from seleniumbase/compatibility-updates-and-more
Compatibility updates and more
2 parents 58ac219 + 09c1b1a commit a567251

File tree

9 files changed

+31
-22
lines changed

9 files changed

+31
-22
lines changed

examples/migration/protractor/mat_paginator_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
from seleniumbase import BaseCase
23

34

examples/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output and disable the cacheprovider.
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4+
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

examples/translations/pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output and disable the cacheprovider.
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4+
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22

3-
# Display console output and disable the cacheprovider.
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, and have the ipdb debugger replace pdb:
4+
addopts = --capture=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:TerminalPdb
55

66
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
77
filterwarnings =

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packaging>=20.9
44
typing-extensions>=3.10.0.0
55
setuptools>=44.1.1;python_version<"3.5"
66
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
7-
setuptools>=56.1.0;python_version>="3.6"
7+
setuptools>=56.2.0;python_version>="3.6"
88
setuptools-scm==5.0.2;python_version<"3.6"
99
setuptools-scm>=6.0.1;python_version>="3.6"
1010
wheel>=0.36.2
@@ -63,7 +63,8 @@ traitlets==4.3.3;python_version<"3.7"
6363
traitlets==5.0.5;python_version>="3.7"
6464
prompt-toolkit==1.0.18;python_version<"3.6"
6565
prompt-toolkit==3.0.18;python_version>="3.6"
66-
decorator==4.4.2
66+
decorator==4.4.2;python_version<"3.5"
67+
decorator==5.0.7;python_version>="3.5"
6768
ipython==5.10.0;python_version<"3.5"
6869
ipython==6.5.0;python_version>="3.5" and python_version<"3.6"
6970
ipython==7.16.1;python_version>="3.6" and python_version<"3.7"
@@ -94,7 +95,7 @@ pdfminer.six==20201018;python_version>="3.5"
9495
coverage==5.5
9596
pytest-cov==2.11.1
9697
flake8==3.7.9;python_version<"3.5"
97-
flake8==3.9.1;python_version>="3.5"
98+
flake8==3.9.2;python_version>="3.5"
9899
pyflakes==2.1.1;python_version<"3.5"
99100
pyflakes==2.3.1;python_version>="3.5"
100101
pycodestyle==2.5.0;python_version<"3.5"

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__ = "1.63.3"
2+
__version__ = "1.63.4"

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def main():
123123

124124
data = []
125125
data.append("[pytest]")
126-
data.append("addopts = --capture=no -p no:cacheprovider")
126+
data.append(
127+
"addopts = --capture=no -p no:cacheprovider "
128+
"--pdbcls=IPython.terminal.debugger:TerminalPdb"
129+
)
127130
data.append("filterwarnings =")
128131
data.append(" ignore::pytest.PytestWarning")
129132
data.append(" ignore:.*U.*mode is deprecated:DeprecationWarning")

seleniumbase/fixtures/base_case.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def test_anything(self):
5757
logging.getLogger("urllib3").setLevel(logging.ERROR)
5858
urllib3.disable_warnings()
5959
LOGGER.setLevel(logging.WARNING)
60+
if sys.version_info[0] < 3:
61+
reload(sys) # noqa: F821
62+
sys.setdefaultencoding("utf8")
6063

6164

6265
class BaseCase(unittest.TestCase):
@@ -3248,14 +3251,14 @@ def print_unique_links_with_status_codes(self):
32483251

32493252
def __fix_unicode_conversion(self, text):
32503253
""" Fixing Chinese characters when converting from PDF to HTML. """
3251-
if sys.version_info[0] < 3:
3252-
# Update encoding for Python 2 users
3253-
reload(sys) # noqa
3254-
sys.setdefaultencoding("utf8")
32553254
text = text.replace("\u2f8f", "\u884c")
32563255
text = text.replace("\u2f45", "\u65b9")
32573256
text = text.replace("\u2f08", "\u4eba")
32583257
text = text.replace("\u2f70", "\u793a")
3258+
text = text.replace("\xe2\xbe\x8f", "\xe8\xa1\x8c")
3259+
text = text.replace("\xe2\xbd\xb0", "\xe7\xa4\xba")
3260+
text = text.replace("\xe2\xbe\x8f", "\xe8\xa1\x8c")
3261+
text = text.replace("\xe2\xbd\x85", "\xe6\x96\xb9")
32593262
return text
32603263

32613264
def get_pdf_text(
@@ -8114,7 +8117,7 @@ def __recalculate_selector(self, selector, by, xp_ok=True):
81148117
_type = type(selector) # First make sure the selector is a string
81158118
not_string = False
81168119
if sys.version_info[0] < 3:
8117-
if _type is not str and _type is not unicode: # noqa
8120+
if _type is not str and _type is not unicode: # noqa: F821
81188121
not_string = True
81198122
else:
81208123
if _type is not str:

setup.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(Uses selenium 3.x and is compatible with Python 2.7+ and Python 3.5+)
44
"""
55

6-
from setuptools import setup, find_packages # noqa
6+
from setuptools import setup, find_packages # noqa: F401
77
import os
88
import sys
99

@@ -31,12 +31,12 @@
3131
reply = None
3232
input_method = input
3333
if not sys.version_info[0] >= 3:
34-
input_method = raw_input # noqa
34+
input_method = raw_input # noqa: F821
3535
confirm_text = ">>> Confirm release PUBLISH to PyPI? (yes/no): "
3636
reply = str(input_method(confirm_text)).lower().strip()
3737
if reply == "yes":
3838
print("\n*** Checking code health with flake8:\n")
39-
os.system("python -m pip install 'flake8==3.9.1'")
39+
os.system("python -m pip install 'flake8==3.9.2'")
4040
flake8_status = os.system("flake8 --exclude=temp")
4141
if flake8_status != 0:
4242
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
@@ -119,7 +119,7 @@
119119
"typing-extensions>=3.10.0.0",
120120
'setuptools>=44.1.1;python_version<"3.5"',
121121
'setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"',
122-
'setuptools>=56.1.0;python_version>="3.6"',
122+
'setuptools>=56.2.0;python_version>="3.6"',
123123
'setuptools-scm==5.0.2;python_version<"3.6"',
124124
'setuptools-scm>=6.0.1;python_version>="3.6"',
125125
"wheel>=0.36.2",
@@ -178,7 +178,8 @@
178178
'traitlets==5.0.5;python_version>="3.7"',
179179
'prompt-toolkit==1.0.18;python_version<"3.6"',
180180
'prompt-toolkit==3.0.18;python_version>="3.6"',
181-
"decorator==4.4.2",
181+
'decorator==4.4.2;python_version<"3.5"',
182+
'decorator==5.0.7;python_version>="3.5"',
182183
'ipython==5.10.0;python_version<"3.5"',
183184
'ipython==6.5.0;python_version>="3.5" and python_version<"3.6"',
184185
'ipython==7.16.1;python_version>="3.6" and python_version<"3.7"',
@@ -212,7 +213,7 @@
212213
# pip install -e .[flake]
213214
"flake": [
214215
'flake8==3.7.9;python_version<"3.5"',
215-
'flake8==3.9.1;python_version>="3.5"',
216+
'flake8==3.9.2;python_version>="3.5"',
216217
'pyflakes==2.1.1;python_version<"3.5"',
217218
'pyflakes==2.3.1;python_version>="3.5"',
218219
'pycodestyle==2.5.0;python_version<"3.5"',

0 commit comments

Comments
 (0)