Skip to content

Commit

Permalink
check before getting message (#11)
Browse files Browse the repository at this point in the history
* check before getting message
* pylint: use-dict-literal
  • Loading branch information
jupe authored Aug 30, 2021
1 parent e35c1d3 commit c1486ca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pytest_opentmi/OpenTmiReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, config):
self.test_logs = []
self.results = []
self.tests = []
self._items = dict()
self._items = {}
self.errors = self.failed = 0
self.passed = self.skipped = 0
self.xfailed = self.xpassed = 0
Expand Down Expand Up @@ -87,8 +87,11 @@ def _append_inconclusive(self, report):
# For now, the only "other" the plugin give support is rerun
result = self._new_result(report)
result.execution.verdict = 'inconclusive'
result.execution.note = f'{report.longrepr.reprcrash.message}\n' \
f'{report.longrepr.reprcrash.path}:{report.longrepr.reprcrash.lineno}'
if report.longrepr.reprcrash:
result.execution.note = f'{report.longrepr.reprcrash.message}\n' \
f'{report.longrepr.reprcrash.path}:{report.longrepr.reprcrash.lineno}'
else:
result.execution.note = ''
self.results.append(result)

# pylint: disable=too-many-branches
Expand Down Expand Up @@ -154,7 +157,7 @@ def _new_result(self, report):
result.job.id = os.environ.get('BUILD_TAG', str(uuid.uuid1()))
result.campaign = os.environ.get('JOB_NAME', "")
if report.user_properties:
result.execution.profiling['properties'] = dict()
result.execution.profiling['properties'] = {}
for (key, value) in report.user_properties:
result.execution.profiling['properties'][key] = value
if report.keywords:
Expand Down

0 comments on commit c1486ca

Please sign in to comment.