MCPcopy
hub / github.com/django/django / __exit__

Method __exit__

django/test/testcases.py:109–126  ·  view source on GitHub ↗
(self, exc_type, exc_value, traceback)

Source from the content-addressed store, hash-verified

107 super().__init__(connection)
108
109 def __exit__(self, exc_type, exc_value, traceback):
110 super().__exit__(exc_type, exc_value, traceback)
111 if exc_type is not None:
112 return
113 executed = len(self)
114 self.test_case.assertEqual(
115 executed,
116 self.num,
117 "%d queries executed, %d expected\nCaptured queries were:\n%s"
118 % (
119 executed,
120 self.num,
121 "\n".join(
122 "%d. %s" % (i, query["sql"])
123 for i, query in enumerate(self.captured_queries, start=1)
124 ),
125 ),
126 )
127
128
129class _AssertTemplateUsedContext:

Callers 1

_rollback_atomicsMethod · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected