Skip to content

Commit 32b8ffa

Browse files
authored
Merge pull request #1624 from seleniumbase/my-own-debugger-and-more
My Own Debugger and More
2 parents 607bf0d + 5f0c93f commit 32b8ffa

File tree

15 files changed

+64
-46
lines changed

15 files changed

+64
-46
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*.egg-info
77
dist
88
build
9-
ghostdriver.log
9+
.eggs
1010
eggs
1111
parts
1212
bin
@@ -90,6 +90,7 @@ latest_logs
9090
log_archives
9191
archived_logs
9292
geckodriver.log
93+
ghostdriver.log
9394
pytestdebug.log
9495

9596
# Reports

examples/boilerplates/samples/google_objects.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ class HomePage(object):
99

1010

1111
class ResultsPage(object):
12-
google_logo = 'img[alt="Google"]'
13-
images_link = "link=Images"
1412
search_results = "div#center_col"

examples/boilerplates/samples/google_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ def test_google_dot_com(self):
1414
self.assert_element(HomePage.feeling_lucky_button)
1515
self.click(HomePage.search_button)
1616
self.assert_text("github.com", ResultsPage.search_results)
17-
self.assert_element(ResultsPage.images_link)

help_docs/recorder_mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pytest new_test.py --rec -q -s --url=wikipedia.org
3737
8 # type "c" and press [ENTER] to continue
3838
9 -> import pdb; pdb.set_trace()
3939
return None
40-
(Pdb++) c
40+
(Pdb+) c
4141

4242
>>>>>>>>>>>>>>>>>> PDB continue >>>>>>>>>>>>>>>>>>
4343

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ mkdocs-material==8.5.10
3333
mkdocs-exclude-search==0.6.4
3434
mkdocs-simple-hooks==0.1.5
3535
mkdocs-material-extensions==1.1.1
36-
mkdocs-minify-plugin==0.6.1
36+
mkdocs-minify-plugin==0.6.2

requirements.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pytest-xdist==1.34.0;python_version<"3.6"
8181
pytest-xdist==2.5.0;python_version>="3.6" and python_version<"3.7"
8282
pytest-xdist==3.0.2;python_version>="3.7"
8383
parameterized==0.8.1
84-
sbvirtualdisplay==1.1.0
84+
sbvirtualdisplay==1.1.1
8585
behave==1.2.6
8686
parse==1.19.0
8787
parse-type==0.6.0
@@ -91,9 +91,14 @@ beautifulsoup4==4.9.3;python_version<"3.6"
9191
beautifulsoup4==4.11.1;python_version>="3.6"
9292
cryptography==2.9.2;python_version<"3.6"
9393
cryptography==36.0.2;python_version>="3.6" and python_version<"3.7"
94-
cryptography==38.0.3;python_version>="3.7"
94+
cryptography==38.0.4;python_version>="3.7"
9595
pygments==2.5.2;python_version<"3.6"
9696
pygments==2.13.0;python_version>="3.6"
97+
pyreadline==2.1;platform_system=="Windows" and python_version<"3.6"
98+
pyreadline3==3.4.1;platform_system=="Windows" and python_version>="3.6"
99+
pyrepl==0.9.0
100+
tabcompleter==1.0.0
101+
pdbp==1.0.0
97102
colorama==0.4.6;python_version<"3.6"
98103
colorama==0.4.5;python_version>="3.6" and python_version<"3.7"
99104
colorama==0.4.6;python_version>="3.7"

seleniumbase/__init__.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import collections
22
import pdb
3-
import shutil
3+
try:
4+
import pdbp # (Pdb+) --- Python Debugger Plus
5+
except Exception:
6+
pass
47
import sys
58
from selenium import webdriver
69
from seleniumbase.__version__ import __version__
@@ -16,20 +19,20 @@
1619
from seleniumbase.plugins.driver_manager import Driver # noqa
1720
from seleniumbase.plugins.driver_manager import DriverContext # noqa
1821

19-
if hasattr(pdb, "DefaultConfig"):
20-
# Only load pdbpp configuration if pdbpp is installed
21-
pdb.DefaultConfig.filename_color = pdb.Color.blue
22-
pdb.DefaultConfig.line_number_color = pdb.Color.turquoise
23-
pdb.DefaultConfig.show_hidden_frames_count = False
24-
pdb.DefaultConfig.disable_pytest_capturing = True
25-
pdb.DefaultConfig.enable_hidden_frames = False
26-
pdb.DefaultConfig.truncate_long_lines = True
27-
pdb.DefaultConfig.sticky_by_default = True
28-
# Fix spacing for line numbers > 9999
29-
pdb.Pdb.get_terminal_size = lambda x: (
30-
shutil.get_terminal_size()[0] - 1,
31-
shutil.get_terminal_size()[1],
32-
)
22+
if sys.version_info[0] < 3 and "pdbp" in locals():
23+
# With Python3, "import pdbp" is all you need
24+
for key in pdbp.__dict__.keys():
25+
# Replace pdb with pdbp
26+
pdb.__dict__[key] = pdbp.__dict__[key]
27+
if hasattr(pdb, "DefaultConfig"):
28+
# Here's how to customize Pdb+ options
29+
pdb.DefaultConfig.filename_color = pdb.Color.blue
30+
pdb.DefaultConfig.line_number_color = pdb.Color.turquoise
31+
pdb.DefaultConfig.show_hidden_frames_count = False
32+
pdb.DefaultConfig.disable_pytest_capturing = True
33+
pdb.DefaultConfig.enable_hidden_frames = False
34+
pdb.DefaultConfig.truncate_long_lines = True
35+
pdb.DefaultConfig.sticky_by_default = True
3336
if sys.version_info[0] >= 3:
3437
from seleniumbase import translate # noqa
3538
if sys.version_info >= (3, 7):

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.9.1"
2+
__version__ = "4.9.2"

seleniumbase/console_scripts/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ sbase mkfile new_test.py
341341
* Options:
342342
343343
``-b`` / ``--basic`` (Basic boilerplate / single-line test)
344-
``-r`` / ``--rec`` (adds ipdb breakpoint for Recorder Mode)
344+
``-r`` / ``--rec`` (adds Pdb+ breakpoint for Recorder Mode)
345345
346346
* Language Options:
347347

seleniumbase/console_scripts/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def show_mkfile_usage():
259259
print(" sbase mkfile new_test.py")
260260
print(" Options:")
261261
print(" -b / --basic (Basic boilerplate / single-line test)")
262-
print(" -r / --rec (add pdb++ breakpoint for Recorder Mode)")
262+
print(" -r / --rec (adds Pdb+ breakpoint for Recorder Mode)")
263263
print(" Language Options:")
264264
print(" --en / --English | --zh / --Chinese")
265265
print(" --nl / --Dutch | --fr / --French")

0 commit comments

Comments
 (0)