frostfs-testlib/src/neofs_testlib/reporter/interfaces.py
Vladimir Domnich 834ddede36 [#5] Remove testlib config file support
In order to make library as flexible as possible we will try to use
configuration methods similar to function `logging.dictConfig` from the
standard library. So, we won't support configuration file
`.neofs-testlib.yaml`, but will allow users to call `configure` method
that will load plugins and initialize library components.

Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
2022-10-07 15:05:48 +04:00

28 lines
809 B
Python

from abc import ABC, abstractmethod
from contextlib import AbstractContextManager
from typing import Any
class ReporterHandler(ABC):
"""Interface of handler that stores test artifacts in some reporting tool."""
@abstractmethod
def step(self, name: str) -> AbstractContextManager:
"""Register a new step in test execution.
Args:
name: Name of the step.
Returns:
Step context.
"""
@abstractmethod
def attach(self, content: Any, file_name: str) -> None:
"""Attach specified content with given file name to the test report.
Args:
content: Content to attach. If content value is not a string, it will be
converted to a string.
file_name: File name of attachment.
"""