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-04-06 01:24 +0000

1from unittest.mock import patch 1efgh

2 

3from docs_src.python_types.tutorial008_py310 import process_items 1efgh

4 

5 

6def test_process_items(): 1efgh

7 with patch("builtins.print") as mock_print: 1abcd

8 process_items({"a": 1.0, "b": 2.5}) 1abcd

9 

10 assert mock_print.call_count == 4 1abcd

11 call_args = [arg.args for arg in mock_print.call_args_list] 1abcd

12 assert call_args == [ 1abcd

13 ("a",), 

14 (1.0,), 

15 ("b",), 

16 (2.5,), 

17 ]