Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 265 for py_test (0.25 sec)

  1. docs/em/docs/tutorial/testing.md

    ## ๐Ÿƒ โšซ๏ธ
    
    โฎ๏ธ ๐Ÿ‘ˆ, ๐Ÿ‘† ๐Ÿ’ช โŽ `pytest`:
    
    <div class="termy">
    
    ```console
    $ pip install pytest
    
    ---> 100%
    ```
    
    </div>
    
    โšซ๏ธ ๐Ÿ”œ ๐Ÿ” ๐Ÿ“ &amp; ๐Ÿ’ฏ ๐Ÿ”, ๐Ÿ› ๏ธ ๐Ÿ‘ซ, &amp; ๐Ÿ“„ ๐Ÿ ๐Ÿ”™ ๐Ÿ‘†.
    
    ๐Ÿƒ ๐Ÿ’ฏ โฎ๏ธ:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ================ test session starts ================
    platform linux -- Python 3.6.9, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  2. docs/ja/docs/tutorial/testing.md

    ## ๅฎŸ่กŒ
    
    ๅพŒใฏใ€`pytest` ใ‚’ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ™ใ‚‹ใ ใ‘ใงใ™:
    
    <div class="termy">
    
    ```console
    $ pip install pytest
    
    ---> 100%
    ```
    
    </div>
    
    ใƒ•ใ‚กใ‚คใƒซใ‚’ๆคœ็Ÿฅใ—ใ€่‡ชๅ‹•ใƒ†ใ‚นใƒˆใ‚’ๅฎŸ่กŒใ—ใ€็ตๆžœใฎใƒฌใƒใƒผใƒˆใ‚’่ฟ”ใ—ใพใ™ใ€‚
    
    ไปฅไธ‹ใงใƒ†ใ‚นใƒˆใ‚’ๅฎŸ่กŒใ—ใพใ™:
    
    <div class="termy">
    
    ```console
    $ pytest
    
    ================ test session starts ================
    platform linux -- Python 3.6.9, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 16:16:02 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_websockets/test_tutorial001.py

    import pytest
    from fastapi.testclient import TestClient
    from fastapi.websockets import WebSocketDisconnect
    
    from docs_src.websockets.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    def test_websocket():
        with pytest.raises(WebSocketDisconnect):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 10 09:08:19 GMT 2020
    - 822 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_first_steps/test_tutorial001.py

    import pytest
    from fastapi.testclient import TestClient
    
    from docs_src.first_steps.tutorial001 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/", 200, {"message": "Hello World"}),
            ("/nonexistent", 404, {"detail": "Not Found"}),
        ],
    )
    def test_get_path(path, expected_status, expected_response):
        response = client.get(path)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.dependencies.tutorial008b_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_get_no_item(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 918 bytes
    - Viewed (0)
  6. tests/test_tutorial/test_extra_models/test_tutorial005_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.extra_models.tutorial005_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_get_items(client: TestClient):
        response = client.get("/keyword-weights/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_header_params/test_tutorial001_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  8. tests/test_computed_fields.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from .utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        from pydantic import BaseModel, computed_field
    
        class Rectangle(BaseModel):
            width: int
            length: int
    
            @computed_field
            @property
            def area(self) -> int:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_header_params/test_tutorial002_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial002_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  10. 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()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.2K bytes
    - Viewed (0)
Back to top