Skip to content

Commit

Permalink
fill-session-id-none-after-session-quit (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
z00sts authored Feb 20, 2018
1 parent 02f984c commit c2770ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions contesto/basis/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def _destroy_session(cls):
cls.driver.quit()
except URLError:
raise ConnectionError('%s:%s' % (cls.driver_settings['host'], cls.driver_settings['port']))
if hasattr(cls.driver, 'session_id'):
cls.driver.session_id = None

@classmethod
def setUpClass(cls):
Expand Down
2 changes: 1 addition & 1 deletion contesto/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ContextFilter(logging.Filter):
def filter(self, record):
for frame in inspect.stack()[1:]:
test = frame[0].f_locals.get("self")
if hasattr(test, "driver") and hasattr(test.driver, "session_id"):
if hasattr(test, "driver") and hasattr(test.driver, "session_id") and test.driver.session_id:
record.session_id = test.driver.session_id
break
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'config/*.ini'
],
},
"version": "0.3.1",
"version": "0.3.2",
"install_requires": [
"selenium==2.52.0",
"Appium-Python-Client==0.24",
Expand Down

0 comments on commit c2770ea

Please sign in to comment.