Coverage for tests / test_tutorial / test_python_types / test_tutorial006.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.tutorial006_py310 import process_items 1efgh

4 

5 

6def test_process_items(): 1efgh

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

8 process_items(["item_a", "item_b", "item_c"]) 1abcd

9 

10 assert mock_print.call_count == 3 1abcd

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

12 assert call_args == [ 1abcd

13 ("item_a",), 

14 ("item_b",), 

15 ("item_c",), 

16 ]