Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 225 for p3_test (0.06 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial003_py39.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_files.tutorial003_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    file_required = {
        "detail": [
            {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py

    import os
    from pathlib import Path
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(scope="module")
    def client():
        static_dir: Path = Path(os.getcwd()) / "static"
        print(static_dir)
        static_dir.mkdir(exist_ok=True)
        from docs_src.custom_docs_ui.tutorial002 import app
    
        with TestClient(app) as client:
            yield client
        static_dir.rmdir()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 19 19:54:04 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_params_str_validations/test_tutorial014_an_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial014_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_hidden_query(client: TestClient):
        response = client.get("/items?hidden_query=somevalue")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

    import os
    from pathlib import Path
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(scope="module")
    def client():
        static_dir: Path = Path(os.getcwd()) / "static"
        print(static_dir)
        static_dir.mkdir(exist_ok=True)
        from docs_src.custom_docs_ui.tutorial001 import app
    
        with TestClient(app) as client:
            yield client
        static_dir.rmdir()
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu May 23 22:59:02 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  5. tests/test_route_scope.py

    import pytest
    from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect
    from fastapi.routing import APIRoute, APIWebSocketRoute
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}")
    async def get_user(user_id: str, request: Request):
        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Feb 08 10:23:07 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_async_tests/test_main.py

    import pytest
    
    from docs_src.async_tests.test_main import test_root
    
    
    @pytest.mark.anyio
    async def test_async_testing():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 06 15:32:11 UTC 2021
    - 143 bytes
    - Viewed (0)
  7. docs/de/docs/advanced/async-tests.md

    {!../../docs_src/async_tests/test_main.py!}
    ```
    
    ## Es ausführen
    
    Sie können Ihre Tests wie gewohnt ausführen mit:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ---> 100%
    ```
    
    </div>
    
    ## Details
    
    Der Marker `@pytest.mark.anyio` teilt pytest mit, dass diese Testfunktion asynchron aufgerufen werden soll:
    
    {* ../../docs_src/async_tests/test_main.py hl[7] *}
    
    /// tip | "Tipp"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:34:47 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/async-tests.md

    {* ../../docs_src/async_tests/test_main.py *}
    
    ## Run it
    
    You can run your tests as usual via:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ---> 100%
    ```
    
    </div>
    
    ## In Detail
    
    The marker `@pytest.mark.anyio` tells pytest that this test function should be called asynchronously:
    
    {* ../../docs_src/async_tests/test_main.py hl[7] *}
    
    /// tip
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:43:29 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_response_model/test_tutorial003_04.py

    import pytest
    from fastapi.exceptions import FastAPIError
    
    
    def test_invalid_response_model():
        with pytest.raises(FastAPIError):
            from docs_src.response_model.tutorial003_04 import app
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Jan 10 16:22:47 UTC 2023
    - 236 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py

    import pytest
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="app")
    def get_app():
        from docs_src.request_files.tutorial002_an_py39 import app
    
        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    @needs_py39
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 8.9K bytes
    - Viewed (0)
Back to top