frostfs-testlib/src/neofs_testlib/reporter/interfaces.py
Vladimir Domnich d3f51ee398 [#7] Add contribution guideline with code style
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
2022-10-06 10:59:26 +04:00

28 lines
804 B
Python

from abc import ABC, abstractmethod
from contextlib import AbstractContextManager
from typing import Any
class Reporter(ABC):
"""Interface that supports storage of 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.
"""