- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 2,269 for Pytest (0.25 sec)
-
tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py
@needs_py310 def test_websocket_no_credentials(app: FastAPI): 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_py310 def test_websocket_invalid_data(app: FastAPI):
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_tutorial/test_websockets/test_tutorial002_py310.py
@needs_py310 def test_websocket_no_credentials(app: FastAPI): 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_py310 def test_websocket_invalid_data(app: FastAPI):
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_multipart_installation.py
def test_incorrect_multipart_installed_file_bytes(monkeypatch): monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False) with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(f: bytes = File()): return f # pragma: nocover def test_incorrect_multipart_installed_multi_form(monkeypatch):
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_invalid_path_param.py
import pytest from fastapi import FastAPI from pydantic import BaseModel def test_invalid_sequence(): with pytest.raises(AssertionError): app = FastAPI() class Item(BaseModel): title: str @app.get("/items/{id}") def read_items(id: List[Item]): pass # pragma: no cover def test_invalid_tuple(): with pytest.raises(AssertionError):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jun 03 17:59:40 GMT 2019 - 1.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") data = response.json()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002.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)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Nov 13 14:26:09 GMT 2022 - 3.6K 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_tutorial/test_dependencies/test_tutorial008c.py
def test_get(client: TestClient): response = client.get("/items/plumbus") assert response.status_code == 200, response.text assert response.json() == "plumbus" def test_fastapi_error(client: TestClient): with pytest.raises(FastAPIError) as exc_info: client.get("/items/portal-gun") assert "No response object was returned" in exc_info.value.args[0] def test_internal_server_error():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 1.1K bytes - Viewed (0) -
tests/test_dependency_contextmanager.py
assert state["/sync"] == "generator completed" def test_sync_async_raise_other(): with pytest.raises(OtherDependencyError): client.get("/sync_async_raise_other") assert state["/async_raise"] == "asyncgen raise finalized" assert "/async_raise" not in errors def test_sync_sync_raise_other(): with pytest.raises(OtherDependencyError): client.get("/sync_sync_raise_other")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 11.6K bytes - Viewed (0) -
tests/test_invalid_sequence_param.py
pass # pragma: no cover def test_invalid_dict(): with pytest.raises(AssertionError): app = FastAPI() class Item(BaseModel): title: str @app.get("/items/") def read_items(q: Dict[str, Item] = Query(default=None)): pass # pragma: no cover def test_invalid_simple_dict(): with pytest.raises(AssertionError): app = FastAPI()
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)