- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 2,264 for Pytest (0.26 sec)
-
docs/en/docs/advanced/async-tests.md
```console $ pytest ---> 100% ``` </div> ## In Detail The marker `@pytest.mark.anyio` tells pytest that this test function should be called asynchronously: ```Python hl_lines="7" {!../../../docs_src/async_tests/test_main.py!} ``` !!! tip Note that the test function is now `async def` instead of just `def` as before when using the `TestClient`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jan 13 12:07:15 GMT 2024 - 3.9K 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) -
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) -
tests/test_ambiguous_params.py
import pytest from fastapi import Depends, FastAPI, Path from fastapi.param_functions import Query from fastapi.testclient import TestClient from fastapi.utils import PYDANTIC_V2 from typing_extensions import Annotated app = FastAPI() def test_no_annotated_defaults(): with pytest.raises( AssertionError, match="Path parameters cannot have a default value" ): @app.get("/items/{item_id}/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Dec 12 00:22:47 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/test_tutorial/test_additional_status_codes/test_tutorial001_py310.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture(name="client") def get_client(): from docs_src.additional_status_codes.tutorial001_py310 import app client = TestClient(app) return client @needs_py310 def test_update(client: TestClient): response = client.put("/items/foo", json={"name": "Wrestlers"}) assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 738 bytes - Viewed (0) -
tests/test_tutorial/test_sql_databases/test_testing_databases.py
import os from pathlib import Path import pytest from ...utils import needs_pydanticv1 # TODO: pv2 add version with Pydantic v2 @needs_pydanticv1 def test_testing_dbs(tmp_path_factory: pytest.TempPathFactory): tmp_path = tmp_path_factory.mktemp("data") cwd = os.getcwd() os.chdir(tmp_path) test_db = Path("./test.db") if test_db.is_file(): # pragma: nocover test_db.unlink()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 788 bytes - Viewed (0) -
tests/test_tutorial/test_events/test_tutorial002.py
import pytest from fastapi import FastAPI from fastapi.testclient import TestClient @pytest.fixture(name="app", scope="module") def get_app(): with pytest.warns(DeprecationWarning): from docs_src.events.tutorial002 import app yield app def test_events(app: FastAPI): with TestClient(app) as client: response = client.get("/items/") assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d.py
import pytest from fastapi.testclient import TestClient @pytest.fixture(name="client") def get_client(): from docs_src.dependencies.tutorial008d import app client = TestClient(app) return client def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
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) -
docs/de/docs/tutorial/testing.md
Führen Sie die Tests aus, mit: <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 rootdir: /home/user/code/superawesome-cli/app plugins: forked-1.1.3, xdist-1.31.0, cov-2.8.1 collected 6 items ---> 100%
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:20:01 GMT 2024 - 7K bytes - Viewed (0) -
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():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Oct 06 15:32:11 GMT 2021 - 143 bytes - Viewed (0)