Commit 9ccae1bd authored by norvell's avatar norvell
Browse files

Exclude Skipped and Failed from exceptions triggering error

parent d630bc4b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ from shutil import move
import tempfile
from typing import Optional, Union, List
import numpy as np
from _pytest.outcomes import Skipped, Failed
from .constants import (
    DMX_DIFF,
    DMX_MLD,
@@ -454,10 +455,11 @@ def pytest_runtest_makereport(item, call):
    test_info = item.funcargs.get("test_info", None)

    if call.excinfo is not None and report.when == "call":
        # Make sure exception is not due to a skipped or failed test (allowed exceptions)
        if call.excinfo.type not in [Skipped, Failed]:
            # Capture exception in test_info
            test_info.error = str(call.excinfo.value)


@pytest.fixture(scope="session")
def split_comparison(request):
    return request.config.option.split_comparison