mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
refactor(scheduler): 重构任务调度器并添加分布式锁支持 test: 重构测试文件结构并添加健康检查测试 style(schema): 统一将example字段改为examples chore: 清理无用的测试文件
19 lines
410 B
Python
19 lines
410 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import sys
|
|
import os
|
|
import pytest
|
|
from fastapi.testclient import TestClient
|
|
|
|
# 导入 main 模块,确保路径正确
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
|
|
from main import create_app
|
|
|
|
# 创建测试客户端
|
|
app = create_app()
|
|
|
|
@pytest.fixture(scope="module")
|
|
def test_client():
|
|
with TestClient(app) as client:
|
|
yield client |