MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / lambda_combinations

Function lambda_combinations

lib/sqlalchemy/testing/util.py:287–301  ·  view source on GitHub ↗
(lambda_arg_sets, **kw)

Source from the content-addressed store, hash-verified

285
286
287def lambda_combinations(lambda_arg_sets, **kw):
288 args = inspect_getfullargspec(lambda_arg_sets)
289
290 arg_sets = lambda_arg_sets(*[mock.Mock() for arg in args[0]])
291
292 def create_fixture(pos):
293 def fixture(**kw):
294 return lambda_arg_sets(**kw)[pos]
295
296 fixture.__name__ = "fixture_%3.3d" % pos
297 return fixture
298
299 return config.combinations(
300 *[(create_fixture(i),) for i in range(len(arg_sets))], **kw
301 )
302
303
304def resolve_lambda(__fn, **kw):

Callers

nothing calls this directly

Calls 3

inspect_getfullargspecFunction · 0.85
create_fixtureFunction · 0.85
combinationsMethod · 0.45

Tested by

no test coverage detected