Skip to content

Commit

Permalink
fix case where not existing fixture leads unexpected exception (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
jupe authored Sep 5, 2024
1 parent eac21a6 commit 3d8c93b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pytest_opentmi/OpenTmiReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import inspect
import logging
from multiprocessing.dummy import Pool as ThreadPool

from _pytest.fixtures import FixtureLookupErrorRepr

# 3rd party modules
from opentmi_client import OpenTmiClient, Result
from opentmi_client.api import Dut, File, Provider, Testcase
Expand Down Expand Up @@ -93,11 +96,12 @@ 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'
if report.longrepr.reprcrash:
result.execution.note = f'{report.longrepr.reprcrash.message}\n' \
f'{report.longrepr.reprcrash.path}:{report.longrepr.reprcrash.lineno}'
if isinstance(report.longrepr, FixtureLookupErrorRepr):
# reprcrash is not available for FixtureLookupError
result.execution.note = f'FixtureLookupError: {report.longrepr}'
else:
result.execution.note = ''
result.execution.note = f'{report.longrepr.reprcrash.message}\n' \
f'{report.longrepr.reprcrash.path}:{report.longrepr.reprcrash.lineno}'
self.results.append(result)

# pylint: disable=too-many-branches
Expand Down

0 comments on commit 3d8c93b

Please sign in to comment.