Coverage for tests / test_tutorial / test_python_types / test_tutorial008.py: 100%
8 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
1from unittest.mock import patch 1defg
3from docs_src.python_types.tutorial008_py310 import process_items 1defg
6def test_process_items(): 1defg
7 with patch("builtins.print") as mock_print: 1abc
8 process_items({"a": 1.0, "b": 2.5}) 1abc
10 assert mock_print.call_count == 4 1abc
11 call_args = [arg.args for arg in mock_print.call_args_list] 1abc
12 assert call_args == [ 1abc
13 ("a",),
14 (1.0,),
15 ("b",),
16 (2.5,),
17 ]