8000 Fill driver.session_id with None after driver.quit() by z00sts · Pull Request #123 · 2gis/contesto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fill driver.session_id with None after driver.quit() #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
B50A
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