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

Function lambda_combinations

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

Source from the content-addressed store, hash-verified

326
327
328def lambda_combinations(lambda_arg_sets, **kw):
329 args = inspect_getfullargspec(lambda_arg_sets)
330
331 arg_sets = lambda_arg_sets(*[mock.Mock() for arg in args[0]])
332
333 def create_fixture(pos):
334 def fixture(**kw):
335 return lambda_arg_sets(**kw)[pos]
336
337 fixture.__name__ = "fixture_%3.3d" % pos
338 return fixture
339
340 return config.combinations(
341 *[(create_fixture(i),) for i in range(len(arg_sets))], **kw
342 )
343
344
345def 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