- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 1,775 for Pytest (0.14 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_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_tutorial/test_dependencies/test_tutorial008c_an.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_datastructures.py
from typing import List import pytest from fastapi import FastAPI, UploadFile from fastapi.datastructures import Default from fastapi.testclient import TestClient # TODO: remove when deprecating Pydantic v1 def test_upload_file_invalid(): with pytest.raises(ValueError): UploadFile.validate("not a Starlette UploadFile") def test_upload_file_invalid_pydantic_v2(): with pytest.raises(ValueError):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py
import pytest from fastapi.exceptions import FastAPIError from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008c_an_py39 import app client = TestClient(app) return client @needs_py39 def test_get_no_item(client: TestClient): response = client.get("/items/foo")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 1.2K bytes - Viewed (0)