MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _assert_depth

Method _assert_depth

test/orm/test_recursive_loaders.py:219–229  ·  view source on GitHub ↗
(self, obj, depth)

Source from the content-addressed store, hash-verified

217 return opt
218
219 def _assert_depth(self, obj, depth):
220 stack = [obj]
221 depth += 1
222
223 while stack and depth:
224 n = stack.pop(0)
225 stack.extend(n.__dict__["children"])
226 depth -= 1
227
228 for n in stack:
229 assert "children" not in n.__dict__
230
231 @testing.combinations(selectinload, immediateload, argnames="loader_fn")
232 @testing.combinations(1, 15, 25, 185, 78, argnames="depth")

Callers 3

test_recursion_depthMethod · 0.95

Calls 2

popMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected