feat(testing): init pytest fixtures
current_test fixture allows to retrieve the current test context, that is exposed through the shell environment
This commit is contained in:
parent
c579ddd022
commit
644beb8696
6 changed files with 51 additions and 2 deletions
14
src/byteb4rb1e/utils/testing/pytest/fixtures.py
Normal file
14
src/byteb4rb1e/utils/testing/pytest/fixtures.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def current_test() -> Tuple[Path, str]:
|
||||
"""
|
||||
"""
|
||||
suite_path, case_name = os.getenv('PYTEST_CURRENT_TEST').split('::', 1)
|
||||
case_name = case_name.split(' ', 1)[0]
|
||||
return Path(suite_path).resolve(), case_name
|
||||
Loading…
Add table
Add a link
Reference in a new issue