mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-13 05:00:50 +00:00
* [python-fastapi] Ignore some flake8 warnings 1. Some of the "imported but not used" warnings are there because it is not easy to express what should be imported in mustache template language. These warnings are silenced in order to keep the templates morre readable. 2. Single quotes -> Double quotes (for consistency). Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com> * [python-fastapi] Added flake8 config Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com> * [python-fastapi] Set extra constraints on values It is important to set all constraints (pattern, greater than, etc.) on values of all arguments, because FastAPI can handle them automatically. Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com> * [python-fastapi] Updated samples Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
18 lines
318 B
Python
18 lines
318 B
Python
import pytest
|
|
from fastapi import FastAPI
|
|
from fastapi.testclient import TestClient
|
|
|
|
from openapi_server.main import app as application
|
|
|
|
|
|
@pytest.fixture
|
|
def app() -> FastAPI:
|
|
application.dependency_overrides = {}
|
|
|
|
return application
|
|
|
|
|
|
@pytest.fixture
|
|
def client(app) -> TestClient:
|
|
return TestClient(app)
|