You've already forked onec_codetemplate_parser
mirror of
https://github.com/240596448/onec_codetemplate_parser.git
synced 2025-11-23 21:34:39 +02:00
24 lines
691 B
Python
24 lines
691 B
Python
"""fixtures for tests"""
|
|
|
|
from pathlib import Path
|
|
import pytest
|
|
|
|
TEST_FILE = 'Documents/1C/1c-code-templates/Надулич.st'
|
|
|
|
@pytest.fixture(scope="class", name="test_file_path")
|
|
def test_data_path():
|
|
return Path.home() / TEST_FILE
|
|
|
|
@pytest.fixture(scope="class")
|
|
def test_data(test_file_path):
|
|
file_data = test_file_path.read_text(encoding='utf-8-sig')
|
|
return file_data
|
|
|
|
@pytest.fixture(scope="class")
|
|
def temp_src(tmp_path_factory):
|
|
"""
|
|
Создаёт временную папку 'src' для теста.
|
|
Папка автоматически удаляется после теста.
|
|
"""
|
|
return tmp_path_factory.mktemp("src")
|