feat: 添加项目规则、环境配置示例及开发文档
This commit is contained in:
22
tests/conftest.py
Normal file
22
tests/conftest.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""pytest 配置和共享 fixtures"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from minenasai.core import reset_settings
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_global_settings():
|
||||
"""每个测试后重置全局配置"""
|
||||
yield
|
||||
reset_settings()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_config(tmp_path):
|
||||
"""创建临时配置目录"""
|
||||
config_dir = tmp_path / ".config" / "minenasai"
|
||||
config_dir.mkdir(parents=True)
|
||||
return config_dir
|
||||
Reference in New Issue
Block a user