Skip to content

pytestutils

pytestutils

Classes

ExptestPytestError

Bases: Exception

Custom exception for error reporting.

ExptestPytestWrapper

ExptestPytestWrapper(
    name, parent, exp_test, target_path, index
)

Bases: Item

Source code in niceml/utilities/pytestutils.py
def __init__(
    self, name, parent, exp_test: ExperimentTest, target_path: str, index: int
):
    super().__init__(name, parent)
    self.exp_test = exp_test
    self.target_path = target_path
    self.index = index
Functions
repr_failure
repr_failure(excinfo, style=None)

Called when self.runtest() raises an exception.

Source code in niceml/utilities/pytestutils.py
def repr_failure(
    self,
    excinfo,
    style=None,
):
    """Called when self.runtest() raises an exception."""
    if isinstance(excinfo.value, ExptestPytestError):
        exp_test_result: ExpTestResult
        _, exp_test_result = excinfo.value.args
        return str(exp_test_result)