Browse Source

Fix test

pull/13918/head
Yurii Motov 1 day ago
parent
commit
330e14bc10
  1. 3
      tests/test_openapi_custom_schema_generator.py

3
tests/test_openapi_custom_schema_generator.py

@ -1,6 +1,7 @@
import pytest
from fastapi import FastAPI
from fastapi._compat import PYDANTIC_V2, GenerateJsonSchema
from fastapi.openapi.constants import REF_TEMPLATE
from fastapi.openapi.utils import get_openapi
app = FastAPI()
@ -14,7 +15,7 @@ def read_root():
# Custom schema generator that does nothing but tracks if it was called
class CustomJsonSchemaGenerator(GenerateJsonSchema):
def __init__(self):
super().__init__()
super().__init__(ref_template=REF_TEMPLATE)
self.called = False
def generate_definitions(self, *args, **kwargs):

Loading…
Cancel
Save