Skip to content

Fix MySQL pytest plugin #22

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 2 commits into from
Feb 20, 2016
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: 1 addition & 1 deletion integrations/docker/docker_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='seleniumbase',
version='1.1.30',
version='1.1.31',
author='Michael Mintz',
author_email='@mintzworld',
maintainer='Michael Mintz',
Expand Down
25 changes: 16 additions & 9 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pytest
import sys
import time
import traceback
import unittest
import uuid
from pyvirtualdisplay import Display
Expand Down Expand Up @@ -414,17 +415,23 @@ def setUp(self):
self.testcase_manager.insert_testcase_data(data_payload)
self.case_start_time = int(time.time() * 1000)

def __insert_test_result(self, state, err=None):
def __insert_test_result(self, state, err):
data_payload = TestcaseDataPayload()
data_payload.runtime = int(time.time() * 1000) - self.case_start_time
data_payload.guid = self.testcase_guid
data_payload.execution_guid = self.execution_guid
data_payload.state = state
if err is not None:
data_payload.message = err[1].__str__().split(
'''-------------------- >> '''
'''begin captured logging'''
''' << --------------------''', 1)[0]
if err:
tb_string = traceback.format_exc()
if "Message: " in tb_string:
data_payload.message = "Message: " + tb_string.split(
"Message: ")[-1]
elif "Exception: " in tb_string:
data_payload.message = tb_string.split("Exception: ")[-1]
elif "Error: " in tb_string:
data_payload.message = tb_string.split("Error: ")[-1]
else:
data_payload.message = "Unknown Error: See Stacktrace"
self.testcase_manager.update_testcase_data(data_payload)

def tearDown(self):
Expand Down Expand Up @@ -469,9 +476,9 @@ def tearDown(self):
self.display.stop()
if self.with_db_reporting:
if sys.exc_info()[1] is not None:
self.__insert_test_result(constants.State.ERROR)
self.__insert_test_result(constants.State.ERROR, True)
else:
self.__insert_test_result(constants.State.PASS)
self.__insert_test_result(constants.State.PASS, False)
runtime = int(time.time() * 1000) - self.execution_start_time
self.testcase_manager.update_execution_data(
self.execution_guid, runtime)
Expand All @@ -496,6 +503,6 @@ def tearDown(self):
if self.with_db_reporting:
self.testcase_manager = TestcaseManager(self.database_env)
data_payload = TestcaseDataPayload()
data_payload.guid = guid
data_payload.guid = self.testcase_guid
data_payload.logURL = index_file
self.testcase_manager.update_testcase_log_url(data_payload)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='seleniumbase',
version='1.1.30',
version='1.1.31',
url='http://seleniumbase.com',
author='Michael Mintz',
author_email='@mintzworld',
Expand Down