pytests
This commit is contained in:
28
tests/conftest.py
Normal file
28
tests/conftest.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Конфигурация pytest для тестов парсеров
|
||||
"""
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Добавляем путь к проекту
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'python_parser'))
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def test_data_dir():
|
||||
"""Путь к директории с тестовыми данными"""
|
||||
return os.path.join(os.path.dirname(__file__), 'test_data')
|
||||
|
||||
@pytest.fixture
|
||||
def mock_data():
|
||||
"""Моковые данные для тестов"""
|
||||
return {
|
||||
'SNPZ': {
|
||||
'data': 'test_data',
|
||||
'records_count': 10
|
||||
},
|
||||
'KNPZ': {
|
||||
'data': 'test_data_2',
|
||||
'records_count': 5
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user