Add test fixture for generating resource paths

A new test fixture was added to generate resource paths based on input arguments. This fixture constructs a path using the parent directory of the current file and specified arguments.
This commit is contained in:
Jakub Jezek 2024-06-07 12:16:37 +02:00
parent 104a71701e
commit 2d50546a45
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -0,0 +1,16 @@
import pytest
from pathlib import Path
collect_ignore = ["vendor", "resources"]
RESOURCES_PATH = 'resources'
@pytest.fixture
def resources_path_factory():
def factory(*args):
dirpath = Path(__file__).parent / RESOURCES_PATH
for arg in args:
dirpath = dirpath / arg
return dirpath
return factory