Nikita Vakula 93880a486e
python-fastapi improvements (#9649)
* [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>
2021-06-03 10:13:24 +08:00

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)