Skip to content

Commit 1d1345e

Browse files
committed
Better error-handling when stopping virtual displays
1 parent 29f6e70 commit 1d1345e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3478,7 +3478,12 @@ def tearDown(self):
34783478
self.__quit_all_drivers()
34793479
if self.headless:
34803480
if self.headless_active:
3481-
self.display.stop()
3481+
try:
3482+
self.display.stop()
3483+
except AttributeError:
3484+
pass
3485+
except Exception:
3486+
pass
34823487
self.display = None
34833488
if self.with_db_reporting:
34843489
if has_exception:

seleniumbase/plugins/selenium_plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,9 @@ def afterTest(self, test):
290290
pass
291291
if self.options.headless:
292292
if self.headless_active:
293-
self.display.stop()
293+
try:
294+
self.display.stop()
295+
except AttributeError:
296+
pass
297+
except Exception:
298+
pass

0 commit comments

Comments
 (0)