MCPcopy Index your code
hub / github.com/fastapi/sqlmodel / test_tutorial

Function test_tutorial

tests/test_tutorial/test_one/test_tutorial004.py:24–45  ·  view source on GitHub ↗
(print_mock: PrintMock, mod: ModuleType)

Source from the content-addressed store, hash-verified

22
23
24def test_tutorial(print_mock: PrintMock, mod: ModuleType):
25 with pytest.raises(MultipleResultsFound):
26 mod.main()
27 with Session(mod.engine) as session:
28 # TODO: create delete() function
29 # TODO: add overloads for .exec() with delete object
30 session.exec(delete(mod.Hero))
31 session.add(mod.Hero(name="Test Hero", secret_name="Secret Test Hero", age=24))
32 session.commit()
33
34 mod.select_heroes()
35 assert print_mock.calls == [
36 [
37 "Hero:",
38 {
39 "id": 1,
40 "name": "Test Hero",
41 "secret_name": "Secret Test Hero",
42 "age": 24,
43 },
44 ]
45 ]

Callers

nothing calls this directly

Calls 2

SessionClass · 0.90
execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…