Coverage for tests/test_tutorial/test_limit_and_offset/test_tutorial002_py310.py: 100%
14 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
7expected_calls = [ 1efghij
8 [
9 [
10 {
11 "id": 4,
12 "name": "Tarantula",
13 "secret_name": "Natalia Roman-on",
14 "age": 32,
15 },
16 {"id": 5, "name": "Black Lion", "secret_name": "Trevor Challa", "age": 35},
17 {"id": 6, "name": "Dr. Weird", "secret_name": "Steve Weird", "age": 36},
18 ]
19 ]
20]
23@needs_py310 1efghij
24def test_tutorial(clear_sqlmodel): 1efghij
25 from docs_src.tutorial.offset_and_limit import tutorial002_py310 as mod 1abcd
27 mod.sqlite_url = "sqlite://" 1abcd
28 mod.engine = create_engine(mod.sqlite_url) 1abcd
29 calls = [] 1abcd
31 new_print = get_testing_print_function(calls) 1abcd
33 with patch("builtins.print", new=new_print): 1abcd
34 mod.main() 1abcd
35 assert calls == expected_calls 1abcd