- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for Builtins (0.03 sec)
-
tests/test_tutorial/test_python_types/test_tutorial006.py
from unittest.mock import patch from docs_src.python_types.tutorial006_py39 import process_items def test_process_items(): with patch("builtins.print") as mock_print: process_items(["item_a", "item_b", "item_c"]) assert mock_print.call_count == 3 call_args = [arg.args for arg in mock_print.call_args_list] assert call_args == [ ("item_a",), ("item_b",), ("item_c",),
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 426 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial008.py
from unittest.mock import patch from docs_src.python_types.tutorial008_py39 import process_items def test_process_items(): with patch("builtins.print") as mock_print: process_items({"a": 1.0, "b": 2.5}) assert mock_print.call_count == 4 call_args = [arg.args for arg in mock_print.call_args_list] assert call_args == [ ("a",), (1.0,), ("b",), (2.5,),
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 417 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial001_tutorial002.py
import pytest @pytest.mark.parametrize( "module_name", [ "tutorial001_py39", "tutorial002_py39", ], ) def test_run_module(module_name: str): with patch("builtins.print") as mock_print: runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 398 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial008b.py
], ) def get_module(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.python_types.{request.param}") return mod def test_process_items(module: ModuleType): with patch("builtins.print") as mock_print: module.process_item("a") assert mock_print.call_count == 1
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 637 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial011.py
@pytest.mark.parametrize( "module_name", [ pytest.param("tutorial011_py39"), pytest.param("tutorial011_py310", marks=needs_py310), ], ) def test_run_module(module_name: str): with patch("builtins.print") as mock_print: runpy.run_module(f"docs_src.python_types.{module_name}", run_name="__main__") assert mock_print.call_count == 2 call_args = [str(arg.args[0]) for arg in mock_print.call_args_list]
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 691 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial009_tutorial009b.py
], ) def get_module(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.python_types.{request.param}") return mod def test_say_hi(module: ModuleType): with patch("builtins.print") as mock_print: module.say_hi("FastAPI") module.say_hi() assert mock_print.call_count == 2 call_args = [arg.args for arg in mock_print.call_args_list] assert call_args == [
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 805 bytes - Viewed (0) -
tests/test_tutorial/test_python_types/test_tutorial009c.py
], ) def get_module(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.python_types.{request.param}") return mod def test_say_hi(module: ModuleType): with patch("builtins.print") as mock_print: module.say_hi("FastAPI") mock_print.assert_called_once_with("Hey FastAPI!") with pytest.raises( TypeError,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 777 bytes - Viewed (0) -
docs/en/docs/python-types.md
#### Generic types { #generic-types } These types that take type parameters in square brackets are called **Generic types** or **Generics**, for example: //// tab | Python 3.10+ You can use the same builtin types as generics (with square brackets and types inside): * `list` * `tuple` * `set` * `dict` And the same as with previous Python versions, from the `typing` module: * `Union` * `Optional`Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 15.6K bytes - Viewed (0)