repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py | import importlib
import pytest
from dirty_equals import IsStr
from fastapi.testclient import TestClient
from inline_snapshot import snapshot
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial015_an_py39"),
pytest.param("tutorial015_an_py310", mar... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial005.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial005_py39"),
pytest.param("tutorial005_an_py39"),
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(
f"docs_s... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial006.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial006_py39"),
pytest.param("tutorial006_an_py39"),
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(
f"docs_s... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial011_py39"),
pytest.param("tutorial011_py310", marks=needs_py310),
pytest.param("tutorial011_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
"tutorial013_py39",
"tutorial013_an_py39",
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(
f"docs_src.query_params_str_validati... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial009.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial009_py39"),
pytest.param("tutorial009_py310", marks=needs_py310),
pytest.param("tutorial009_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/__init__.py | tests/test_tutorial/test_query_params_str_validations/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py | import importlib
import pytest
from fastapi._compat import PYDANTIC_VERSION_MINOR_TUPLE
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial010_py39"),
pytest.param("tutorial010_py310", marks=needs_py310),
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial004_py39"),
pytest.param("tutorial004_py310", marks=needs_py310),
pytest.param("tutorial004_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial008_py39"),
pytest.param("tutorial008_py310", marks=needs_py310),
pytest.param("tutorial008_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial003.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial003_py39"),
pytest.param("tutorial003_py310", marks=needs_py310),
pytest.param("tutorial003_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py | tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial012_py39"),
pytest.param("tutorial012_an_py39"),
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(
f"docs_s... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/test_tutorial002.py | tests/test_tutorial/test_request_files/test_tutorial002.py | import importlib
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
@pytest.fixture(
name="app",
params=[
"tutorial002_py39",
"tutorial002_an_py39",
],
)
def get_app(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_file... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/test_tutorial001.py | tests/test_tutorial/test_request_files/test_tutorial001.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
"tutorial001_py39",
"tutorial001_an_py39",
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_files.{request.param}")
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/test_tutorial001_02.py | tests/test_tutorial/test_request_files/test_tutorial001_02.py | import importlib
from pathlib import Path
import pytest
from fastapi.testclient import TestClient
from inline_snapshot import snapshot
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial001_02_py39"),
pytest.param("tutorial001_02_py310", marks=nee... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/test_tutorial001_03.py | tests/test_tutorial/test_request_files/test_tutorial001_03.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
"tutorial001_03_py39",
"tutorial001_03_an_py39",
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_files.{request.param... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/__init__.py | tests/test_tutorial/test_request_files/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_files/test_tutorial003.py | tests/test_tutorial/test_request_files/test_tutorial003.py | import importlib
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
@pytest.fixture(
name="app",
params=[
"tutorial003_py39",
"tutorial003_an_py39",
],
)
def get_app(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_file... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py | tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py | import importlib
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
@pytest.fixture(
name="app",
params=[
"tutorial001_py39",
"tutorial001_an_py39",
],
)
def get_app(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_form... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_forms_and_files/__init__.py | tests/test_tutorial/test_request_forms_and_files/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_cors/test_tutorial001.py | tests/test_tutorial/test_cors/test_tutorial001.py | from fastapi.testclient import TestClient
from docs_src.cors.tutorial001_py39 import app
def test_cors():
client = TestClient(app)
# Test pre-flight response
headers = {
"Origin": "https://localhost.tiangolo.com",
"Access-Control-Request-Method": "GET",
"Access-Control-Request-Hea... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_cors/__init__.py | tests/test_tutorial/test_cors/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_testing_dependencies/test_tutorial001.py | tests/test_tutorial/test_testing_dependencies/test_tutorial001.py | import importlib
from types import ModuleType
import pytest
from ...utils import needs_py310
@pytest.fixture(
name="test_module",
params=[
pytest.param("tutorial001_py39"),
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_an_py39"),
pytest.param... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_testing_dependencies/__init__.py | tests/test_tutorial/test_testing_dependencies/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/test_tutorial002.py | tests/test_tutorial/test_schema_extra_example/test_tutorial002.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial002_py39"),
pytest.param("tutorial002_py310", marks=needs_py310),
],
)
def get_client(request: pytest.FixtureRequest):
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/test_tutorial001.py | tests/test_tutorial/test_schema_extra_example/test_tutorial001.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial001_py39"),
pytest.param("tutorial001_py310", marks=needs_py310),
],
)
def get_client(request: pytest.FixtureRequest):
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/test_tutorial005.py | tests/test_tutorial/test_schema_extra_example/test_tutorial005.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial005_py39"),
pytest.param("tutorial005_py310", marks=needs_py310),
pytest.param("tutorial005_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/__init__.py | tests/test_tutorial/test_schema_extra_example/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/test_tutorial004.py | tests/test_tutorial/test_schema_extra_example/test_tutorial004.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial004_py39"),
pytest.param("tutorial004_py310", marks=needs_py310),
pytest.param("tutorial004_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_schema_extra_example/test_tutorial003.py | tests/test_tutorial/test_schema_extra_example/test_tutorial003.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial003_py39"),
pytest.param("tutorial003_py310", marks=needs_py310),
pytest.param("tutorial003_an_py39"),
pyte... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_forms/test_tutorial001.py | tests/test_tutorial/test_request_forms/test_tutorial001.py | import importlib
import pytest
from fastapi.testclient import TestClient
@pytest.fixture(
name="client",
params=[
"tutorial001_py39",
"tutorial001_an_py39",
],
)
def get_client(request: pytest.FixtureRequest):
mod = importlib.import_module(f"docs_src.request_forms.{request.param}")
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_request_forms/__init__.py | tests/test_tutorial/test_request_forms/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_response_cookies/test_tutorial002.py | tests/test_tutorial/test_response_cookies/test_tutorial002.py | from fastapi.testclient import TestClient
from docs_src.response_cookies.tutorial002_py39 import app
client = TestClient(app)
def test_path_operation():
response = client.post("/cookie-and-object/")
assert response.status_code == 200, response.text
assert response.json() == {"message": "Come to the dark... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_response_cookies/test_tutorial001.py | tests/test_tutorial/test_response_cookies/test_tutorial001.py | from fastapi.testclient import TestClient
from docs_src.response_cookies.tutorial001_py39 import app
client = TestClient(app)
def test_path_operation():
response = client.post("/cookie/")
assert response.status_code == 200, response.text
assert response.json() == {"message": "Come to the dark side, we h... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_response_cookies/__init__.py | tests/test_tutorial/test_response_cookies/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py | import importlib
import pytest
from dirty_equals import IsList
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial002_py39"),
pytest.param("tutorial002_py310", marks=needs_py310),
],
)
def get_client(r... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py | import importlib
import pytest
from dirty_equals import IsList
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial001_py39"),
pytest.param("tutorial001_py310", marks=needs_py310),
],
)
def get_client(r... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py | import importlib
import pytest
from fastapi.testclient import TestClient
from ...utils import needs_py310
@pytest.fixture(
name="client",
params=[
pytest.param("tutorial005_py39"),
pytest.param("tutorial005_py310", marks=needs_py310),
],
)
def get_client(request: pytest.FixtureRequest):
... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py | import pytest
from fastapi.testclient import TestClient
from docs_src.path_operation_configuration.tutorial006_py39 import app
client = TestClient(app)
@pytest.mark.parametrize(
"path,expected_status,expected_response",
[
("/items/", 200, [{"name": "Foo", "price": 42}]),
("/users/", 200, [{"... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/__init__.py | tests/test_tutorial/test_path_operation_configurations/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py | import importlib
from textwrap import dedent
import pytest
from dirty_equals import IsList
from fastapi.testclient import TestClient
from ...utils import needs_py310
DESCRIPTIONS = {
"tutorial003": "Create an item with all the information, name, description, price, tax and a set of unique tags",
"tutorial004... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_tutorial/test_path_operation_configurations/test_tutorial002b.py | tests/test_tutorial/test_path_operation_configurations/test_tutorial002b.py | from fastapi.testclient import TestClient
from docs_src.path_operation_configuration.tutorial002b_py39 import app
client = TestClient(app)
def test_get_items():
response = client.get("/items/")
assert response.status_code == 200, response.text
assert response.json() == ["Portal gun", "Plumbus"]
def te... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/benchmarks/test_general_performance.py | tests/benchmarks/test_general_performance.py | import json
import sys
from collections.abc import Iterator
from typing import Annotated, Any
import pytest
from fastapi import Depends, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel
if "--codspeed" not in sys.argv:
pytest.skip(
"Benchmark tests are skipped by default; r... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/benchmarks/__init__.py | tests/benchmarks/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/__init__.py | tests/test_request_params/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_cookie/test_optional_list.py | tests/test_request_params/test_cookie/test_optional_list.py | # Currently, there is no way to pass multiple cookies with the same name.
# The only way to pass multiple values for cookie params is to serialize them using
# a comma as a delimiter, but this is not currently supported by Starlette.
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_cookie/test_list.py | tests/test_request_params/test_cookie/test_list.py | # Currently, there is no way to pass multiple cookies with the same name.
# The only way to pass multiple values for cookie params is to serialize them using
# a comma as a delimiter, but this is not currently supported by Starlette.
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_cookie/__init__.py | tests/test_request_params/test_cookie/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_cookie/test_required_str.py | tests/test_request_params/test_cookie/test_required_str.py | from typing import Annotated
import pytest
from dirty_equals import IsOneOf
from fastapi import Cookie, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_cookie/test_optional_str.py | tests/test_request_params/test_cookie/test_optional_str.py | from typing import Annotated, Optional
import pytest
from fastapi import Cookie, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@app.get("/optional-str"... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/test_optional_list.py | tests/test_request_params/test_body/test_optional_list.py | from typing import Annotated, Optional
import pytest
from fastapi import Body, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# With... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/test_list.py | tests/test_request_params/test_body/test_list.py | from typing import Annotated, Union
import pytest
from dirty_equals import IsOneOf, IsPartialDict
from fastapi import Body, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# ===============================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/utils.py | tests/test_request_params/test_body/utils.py | from typing import Any
def get_body_model_name(openapi: dict[str, Any], path: str) -> str:
body = openapi["paths"][path]["post"]["requestBody"]
body_schema = body["content"]["application/json"]["schema"]
return body_schema.get("$ref", "").split("/")[-1]
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/__init__.py | tests/test_request_params/test_body/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/test_required_str.py | tests/test_request_params/test_body/test_required_str.py | from typing import Annotated, Any, Union
import pytest
from dirty_equals import IsOneOf
from fastapi import Body, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =========================================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_body/test_optional_str.py | tests/test_request_params/test_body/test_optional_str.py | from typing import Annotated, Optional
import pytest
from fastapi import Body, FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# With... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_query/test_optional_list.py | tests/test_request_params/test_query/test_optional_list.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@app.get("/optional-list-... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_query/test_list.py | tests/test_request_params/test_query/test_list.py | from typing import Annotated
import pytest
from dirty_equals import IsOneOf
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@a... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_query/__init__.py | tests/test_request_params/test_query/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_query/test_required_str.py | tests/test_request_params/test_query/test_required_str.py | from typing import Annotated
import pytest
from dirty_equals import IsOneOf
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@a... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_query/test_optional_str.py | tests/test_request_params/test_query/test_optional_str.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@app.get("/optional-str")... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/test_optional_list.py | tests/test_request_params/test_form/test_optional_list.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# With... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/test_list.py | tests/test_request_params/test_form/test_list.py | from typing import Annotated
import pytest
from dirty_equals import IsOneOf, IsPartialDict
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# ======================================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/utils.py | tests/test_request_params/test_form/utils.py | from typing import Any
def get_body_model_name(openapi: dict[str, Any], path: str) -> str:
body = openapi["paths"][path]["post"]["requestBody"]
body_schema = body["content"]["application/x-www-form-urlencoded"]["schema"]
return body_schema.get("$ref", "").split("/")[-1]
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/__init__.py | tests/test_request_params/test_form/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/test_required_str.py | tests/test_request_params/test_form/test_required_str.py | from typing import Annotated
import pytest
from dirty_equals import IsOneOf
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_form/test_optional_str.py | tests/test_request_params/test_form/test_optional_str.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# With... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/test_optional_list.py | tests/test_request_params/test_file/test_optional_list.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, File, UploadFile
from fastapi.testclient import TestClient
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# Without aliases
@app.post("/... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/test_optional.py | tests/test_request_params/test_file/test_optional.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, File, UploadFile
from fastapi.testclient import TestClient
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# Without aliases
@app.post("/... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/test_required.py | tests/test_request_params/test_file/test_required.py | from typing import Annotated
import pytest
from fastapi import FastAPI, File, UploadFile
from fastapi.testclient import TestClient
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# Without aliases
@app.post("/required-b... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/test_list.py | tests/test_request_params/test_file/test_list.py | from typing import Annotated
import pytest
from fastapi import FastAPI, File, UploadFile
from fastapi.testclient import TestClient
from .utils import get_body_model_name
app = FastAPI()
# =====================================================================================
# Without aliases
@app.post("/list-bytes... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/utils.py | tests/test_request_params/test_file/utils.py | from typing import Any
def get_body_model_name(openapi: dict[str, Any], path: str) -> str:
body = openapi["paths"][path]["post"]["requestBody"]
body_schema = body["content"]["multipart/form-data"]["schema"]
return body_schema.get("$ref", "").split("/")[-1]
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_file/__init__.py | tests/test_request_params/test_file/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_path/test_optional_list.py | tests/test_request_params/test_path/test_optional_list.py | # Optional Path parameters are not supported
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_path/test_list.py | tests/test_request_params/test_path/test_list.py | # FastAPI doesn't currently support non-scalar Path parameters
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_path/__init__.py | tests/test_request_params/test_path/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_path/test_required_str.py | tests/test_request_params/test_path/test_required_str.py | from typing import Annotated
import pytest
from fastapi import FastAPI, Path
from fastapi.testclient import TestClient
app = FastAPI()
@app.get("/required-str/{p}")
async def read_required_str(p: Annotated[str, Path()]):
return {"p": p}
@app.get("/required-alias/{p_alias}")
async def read_required_alias(p: An... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_path/test_optional_str.py | tests/test_request_params/test_path/test_optional_str.py | # Optional Path parameters are not supported
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_header/test_optional_list.py | tests/test_request_params/test_header/test_optional_list.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Header
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@app.get("/optional-list... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_header/test_list.py | tests/test_request_params/test_header/test_list.py | from typing import Annotated
import pytest
from dirty_equals import AnyThing, IsOneOf, IsPartialDict
from fastapi import FastAPI, Header
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# ==================================================================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_header/__init__.py | tests/test_request_params/test_header/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_header/test_required_str.py | tests/test_request_params/test_header/test_required_str.py | from typing import Annotated
import pytest
from dirty_equals import AnyThing, IsOneOf, IsPartialDict
from fastapi import FastAPI, Header
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# ==================================================================================... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_request_params/test_header/test_optional_str.py | tests/test_request_params/test_header/test_optional_str.py | from typing import Annotated, Optional
import pytest
from fastapi import FastAPI, Header
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
app = FastAPI()
# =====================================================================================
# Without aliases
@app.get("/optional-str"... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/test_main.py | tests/test_modules_same_name_body/test_main.py | import pytest
from fastapi.testclient import TestClient
from .app.main import app
client = TestClient(app)
@pytest.mark.parametrize(
"path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"]
)
def test_post(path):
data = {"a": 2, "b": "foo"}
response = client.post(path, json=data)
assert re... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/__init__.py | tests/test_modules_same_name_body/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/app/b.py | tests/test_modules_same_name_body/app/b.py | from fastapi import APIRouter, Body
router = APIRouter()
@router.post("/compute/")
def compute(a: int = Body(), b: str = Body()):
return {"a": a, "b": b}
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/app/a.py | tests/test_modules_same_name_body/app/a.py | from fastapi import APIRouter, Body
router = APIRouter()
@router.post("/compute")
def compute(a: int = Body(), b: str = Body()):
return {"a": a, "b": b}
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/app/main.py | tests/test_modules_same_name_body/app/main.py | from fastapi import FastAPI
from . import a, b
app = FastAPI()
app.include_router(a.router, prefix="/a")
app.include_router(b.router, prefix="/b")
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_modules_same_name_body/app/__init__.py | tests/test_modules_same_name_body/app/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_validate_response_recursive/test_validate_response_recursive.py | tests/test_validate_response_recursive/test_validate_response_recursive.py | from fastapi.testclient import TestClient
from .app import app
def test_recursive():
client = TestClient(app)
response = client.get("/items/recursive")
assert response.status_code == 200, response.text
assert response.json() == {
"sub_items": [{"name": "subitem", "sub_items": []}],
"n... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_validate_response_recursive/__init__.py | tests/test_validate_response_recursive/__init__.py | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false | |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/tests/test_validate_response_recursive/app.py | tests/test_validate_response_recursive/app.py | from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class RecursiveItem(BaseModel):
sub_items: list["RecursiveItem"] = []
name: str
class RecursiveSubitemInSubmodel(BaseModel):
sub_items2: list["RecursiveItemViaSubmodel"] = []
name: str
class RecursiveItemViaSubmodel(BaseMo... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/params.py | fastapi/params.py | import warnings
from collections.abc import Sequence
from dataclasses import dataclass
from enum import Enum
from typing import Annotated, Any, Callable, Optional, Union
from fastapi.exceptions import FastAPIDeprecationWarning
from fastapi.openapi.models import Example
from pydantic import AliasChoices, AliasPath
from... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/staticfiles.py | fastapi/staticfiles.py | from starlette.staticfiles import StaticFiles as StaticFiles # noqa
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/cli.py | fastapi/cli.py | try:
from fastapi_cli.cli import main as cli_main
except ImportError: # pragma: no cover
cli_main = None # type: ignore
def main() -> None:
if not cli_main: # type: ignore[truthy-function]
message = 'To use the fastapi command, please install "fastapi[standard]":\n\n\tpip install "fastapi[stan... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/exception_handlers.py | fastapi/exception_handlers.py | from fastapi.encoders import jsonable_encoder
from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError
from fastapi.utils import is_body_allowed_for_status_code
from fastapi.websockets import WebSocket
from starlette.exceptions import HTTPException
from starlette.requests import Request
fr... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/requests.py | fastapi/requests.py | from starlette.requests import HTTPConnection as HTTPConnection # noqa: F401
from starlette.requests import Request as Request # noqa: F401
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/datastructures.py | fastapi/datastructures.py | from collections.abc import Mapping
from typing import (
Annotated,
Any,
BinaryIO,
Callable,
Optional,
TypeVar,
cast,
)
from annotated_doc import Doc
from pydantic import GetJsonSchemaHandler
from starlette.datastructures import URL as URL # noqa: F401
from starlette.datastructures import ... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/exceptions.py | fastapi/exceptions.py | from collections.abc import Sequence
from typing import Annotated, Any, Optional, TypedDict, Union
from annotated_doc import Doc
from pydantic import BaseModel, create_model
from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.exceptions import WebSocketException as StarletteWebSocke... | python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
fastapi/fastapi | https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/fastapi/logger.py | fastapi/logger.py | import logging
logger = logging.getLogger("fastapi")
| python | MIT | f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a | 2026-01-04T14:38:15.465144Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.