- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 265 for py_test (0.22 sec)
-
tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py
client = TestClient(app) with pytest.raises(WebSocketDisconnect): with client.websocket_connect("/items/foo/ws"): pytest.fail( "did not raise WebSocketDisconnect on __enter__" ) # pragma: no cover @needs_py39 def test_websocket_invalid_data(app: FastAPI): client = TestClient(app) with pytest.raises(WebSocketDisconnect):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 3.9K bytes - Viewed (0) -
tests/test_invalid_sequence_param.py
from typing import Dict, List, Optional, Tuple import pytest from fastapi import FastAPI, Query from pydantic import BaseModel def test_invalid_sequence(): with pytest.raises(AssertionError): app = FastAPI() class Item(BaseModel): title: str @app.get("/items/") def read_items(q: List[Item] = Query(default=None)): pass # pragma: no cover
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 1.2K bytes - Viewed (0) -
tests/test_multipart_installation.py
import pytest from fastapi import FastAPI, File, Form, UploadFile from fastapi.dependencies.utils import ( multipart_incorrect_install_error, multipart_not_installed_error, ) def test_incorrect_multipart_installed_form(monkeypatch): monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False) with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 3.7K bytes - Viewed (0) -
tests/test_validate_response.py
{"name": "baz", "price": "baz"}, ] client = TestClient(app) def test_invalid(): with pytest.raises(ResponseValidationError): client.get("/items/invalid") def test_invalid_none(): with pytest.raises(ResponseValidationError): client.get("/items/invalidnone") def test_valid_none_data(): response = client.get("/items/validnone")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2K bytes - Viewed (0) -
docs/ru/docs/tutorial/testing.md
## Запуск тестов Далее Вам нужно установить `pytest`: <div class="termy"> ```console $ pip install pytest ---> 100% ``` </div> Он автоматически найдёт все файлы и тесты, выполнит их и предоставит Вам отчёт о результатах тестирования. Запустите тесты командой `pytest` и увидите результат: <div class="termy"> ```console $ pytest
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 10.2K bytes - Viewed (0) -
tests/test_validate_response_dataclass.py
] client = TestClient(app) def test_invalid(): with pytest.raises(ResponseValidationError): client.get("/items/invalid") def test_double_invalid(): with pytest.raises(ResponseValidationError): client.get("/items/innerinvalid") def test_invalid_list(): with pytest.raises(ResponseValidationError):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 1.2K bytes - Viewed (0) -
tests/utils.py
import sys import pytest from fastapi._compat import PYDANTIC_V2 needs_py39 = pytest.mark.skipif(sys.version_info < (3, 9), reason="requires python3.9+") needs_py310 = pytest.mark.skipif( sys.version_info < (3, 10), reason="requires python3.10+" ) needs_pydanticv2 = pytest.mark.skipif(not PYDANTIC_V2, reason="requires Pydantic v2")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 422 bytes - Viewed (0) -
docs/en/docs/tutorial/testing.md
## Run it After that, you just need to install `pytest`: <div class="termy"> ```console $ pip install pytest ---> 100% ``` </div> It will detect the files and tests automatically, execute them, and report the results back to you. Run the tests with: <div class="termy"> ```console $ pytest ================ test session starts ================
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 6.2K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_an.py
def test_websocket_no_credentials(): client = TestClient(app) with pytest.raises(WebSocketDisconnect): with client.websocket_connect("/items/foo/ws"): pytest.fail( "did not raise WebSocketDisconnect on __enter__" ) # pragma: no cover def test_websocket_invalid_data(): client = TestClient(app) with pytest.raises(WebSocketDisconnect):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 3.6K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/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.websockets.tutorial003_py39 import app return app @pytest.fixture(name="html") def get_html(): from docs_src.websockets.tutorial003_py39 import html return html @pytest.fixture(name="client")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 1.3K bytes - Viewed (0)