[#132] Add steps logger and refactor reporter usage

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-11-28 12:28:44 +03:00 committed by Andrey Berezin
parent 47414eb866
commit 39a17f3634
9 changed files with 163 additions and 16 deletions

View file

@ -1,5 +1,5 @@
import os
from contextlib import AbstractContextManager
from contextlib import AbstractContextManager, ContextDecorator
from textwrap import shorten
from typing import Any, Callable
@ -12,7 +12,7 @@ from frostfs_testlib.reporter.interfaces import ReporterHandler
class AllureHandler(ReporterHandler):
"""Handler that stores test artifacts in Allure report."""
def step(self, name: str) -> AbstractContextManager:
def step(self, name: str) -> AbstractContextManager | ContextDecorator:
name = shorten(name, width=140, placeholder="...")
return allure.step(name)