Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for get_app (0.03 sec)

  1. tests/test_tutorial/test_settings/test_tutorial001.py

    import importlib
    
    import pytest
    from fastapi.testclient import TestClient
    from pytest import MonkeyPatch
    
    
    @pytest.fixture(name="app", params=[pytest.param("tutorial001_py39")])
    def get_app(request: pytest.FixtureRequest, monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        mod = importlib.import_module(f"docs_src.settings.{request.param}")
        return mod.app
    
    
    def test_settings(app):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 690 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

    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_forms_and_files.{request.param}")
    
        return mod.app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002.py

    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_files.{request.param}")
    
        return mod.app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  4. tests/test_openapi_servers.py

            },
            {"url": "https://prod.example.com"},
        ]
    )
    
    
    @app.get("/foo")
    def foo():
        return {"message": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_app():
        response = client.get("/foo")
        assert response.status_code == 200, response.text
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 1.7K bytes
    - Viewed (0)
Back to top