Coverage for tests/test_tutorial/test_where/test_tutorial009_py310.py: 100%
13 statements
« prev ^ index » next coverage.py v7.7.1, created at 2025-03-24 00:02 +0000
« prev ^ index » next coverage.py v7.7.1, created at 2025-03-24 00:02 +0000
1from unittest.mock import patch 1efghij
3from sqlmodel import create_engine 1efghij
5from ...conftest import get_testing_print_function, needs_py310 1efghij
8@needs_py310 1efghij
9def test_tutorial(clear_sqlmodel): 1efghij
10 from docs_src.tutorial.where import tutorial009_py310 as mod 1abcd
12 mod.sqlite_url = "sqlite://" 1abcd
13 mod.engine = create_engine(mod.sqlite_url) 1abcd
14 calls = [] 1abcd
16 new_print = get_testing_print_function(calls) 1abcd
18 with patch("builtins.print", new=new_print): 1abcd
19 mod.main() 1abcd
20 assert calls == [ 1abcd
21 [{"name": "Tarantula", "secret_name": "Natalia Roman-on", "age": 32, "id": 4}],
22 [{"name": "Black Lion", "secret_name": "Trevor Challa", "age": 35, "id": 5}],
23 [
24 {
25 "name": "Captain North America",
26 "secret_name": "Esteban Rogelios",
27 "age": 93,
28 "id": 7,
29 }
30 ],
31 ]