File size: 495 Bytes
edc06cb
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from typing import Any

from fastapi import FastAPI
from syrupy.assertion import SnapshotAssertion


def test_OpenAPIの形が変わっていないことを確認(
    app: FastAPI, snapshot_json: SnapshotAssertion
) -> None:
    # 変更があった場合はREADMEの「スナップショットの更新」の手順で更新可能
    openapi: Any = (
        app.openapi()
    )  # snapshot_jsonがmypyに対応していないのでワークアラウンド
    assert snapshot_json == openapi