Merge pull request #101 from ktp420/zombie_browsers
Cleanup browser and other process if setup fails
This commit is contained in:
commit
e06454faca
|
@ -128,8 +128,21 @@ def pytest_runtest_setup():
|
|||
pass
|
||||
|
||||
|
||||
def pytest_runtest_teardown():
|
||||
""" This runs after every test with pytest """
|
||||
def pytest_runtest_teardown(item):
|
||||
try:
|
||||
self = item._testcase
|
||||
try:
|
||||
if hasattr(self, 'driver') and self.driver:
|
||||
self.driver.quit()
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if hasattr(self, 'headless') and self.headless:
|
||||
if self.headless_active:
|
||||
self.display.stop()
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue