def pytest_runtest_makereport(item, call): """Override in order to inject `excinfo` for internalerror. :type item: :py:class:`_pytest.python.Function` :type call: :py:class:`_pytest.runner.CallInfo` """ excinfo = call.excinfo try: result = orig_pytest_runtest_makereport(item, call) finally: result.excinfo = excinfo return result
def pytest_runtest_makereport(item, call): """Override in order to inject `excinfo` for internalerror. :type item: :py:class:`_pytest.python.Function` :type call: :py:class:`_pytest.runner.CallInfo` """ excinfo = call.excinfo try: result = orig_pytest_runtest_makereport(item, call) finally: result.excinfo = excinfo return result
def pytest_runtest_makereport(item, call): """Post-processing test reports to exclude those known to be failing.""" tr = orig_pytest_runtest_makereport(item, call) if "skip_unsupported" in item.keywords and item.config.option.skip_ops: if call.excinfo is not None: # Exclude failing test cases for unsupported operations/observables # and those using not implemented features if (call.excinfo.type == qml.DeviceError and "supported" in str(call.excinfo.value) or call.excinfo.type == NotImplementedError): tr.wasxfail = "reason:" + str(call.excinfo.value) tr.outcome = "skipped" return tr