Coverage for tests/test_tutorial/test_where/test_tutorial005.py: 100%
12 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-27 00:03 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-27 00:03 +0000
1from unittest.mock import patch 1klmnopqrst
3from sqlmodel import create_engine 1klmnopqrst
5from ...conftest import get_testing_print_function 1klmnopqrst
8def test_tutorial(clear_sqlmodel): 1klmnopqrst
9 from docs_src.tutorial.where import tutorial005 as mod 1abcdefghij
11 mod.sqlite_url = "sqlite://" 1abcdefghij
12 mod.engine = create_engine(mod.sqlite_url) 1abcdefghij
13 calls = [] 1abcdefghij
15 new_print = get_testing_print_function(calls) 1abcdefghij
17 with patch("builtins.print", new=new_print): 1abcdefghij
18 mod.main() 1abcdefghij
19 assert calls == [ 1abcdefghij
20 [{"name": "Tarantula", "secret_name": "Natalia Roman-on", "age": 32, "id": 4}]
21 ]