Skip to content

Commit da45232

Browse files
committed
Make sure "--pdb" doesn't skip tearDown() on failures
1 parent 29ba2cf commit da45232

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

seleniumbase/plugins/pytest_plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,14 @@ def pytest_runtest_teardown(item):
600600
try:
601601
self = item._testcase
602602
try:
603-
if hasattr(self, 'driver') and self.driver:
603+
if hasattr(self, 'driver') and self.driver and (
604+
"--pdb" not in sys.argv):
604605
self.driver.quit()
605606
except Exception:
606607
pass
607608
try:
608609
if hasattr(self, 'headless') and self.headless:
609-
if self.headless_active:
610+
if self.headless_active and "--pdb" not in sys.argv:
610611
if hasattr(self, 'display') and self.display:
611612
self.display.stop()
612613
except Exception:

0 commit comments

Comments
 (0)