Coverage for tests / test_tutorial / test_python_types / test_tutorial008b.py: 100%
14 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
1import importlib 1abdc
2from types import ModuleType 1abdc
3from unittest.mock import patch 1abdc
5import pytest 1abdc
7from ...utils import needs_py310 1abdc
10@pytest.fixture( 1abdc
11 name="module",
12 params=[
13 pytest.param("tutorial008b_py310"),
14 pytest.param("tutorial008b_py310", marks=needs_py310),
15 ],
16)
17def get_module(request: pytest.FixtureRequest): 1abdc
18 mod = importlib.import_module(f"docs_src.python_types.{request.param}") 1abc
19 return mod 1abc
22def test_process_items(module: ModuleType): 1abdc
23 with patch("builtins.print") as mock_print: 1efg
24 module.process_item("a") 1efg
26 assert mock_print.call_count == 1 1efg
27 mock_print.assert_called_with("a") 1efg