MCPcopy Create free account
hub / github.com/hyperopt/hyperopt / test_partial

Function test_partial

hyperopt/pyll/tests/test_base.py:243–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241
242
243def test_partial():
244 add2 = scope.partial("add", 2)
245 print(add2)
246 assert len(str(add2).split("\n")) == 3
247
248 # add2 evaluates to a scope method
249 thing = rec_eval(add2)
250 print(thing)
251 assert "SymbolTableEntry" in str(thing)
252
253 # add2() evaluates to a failure because it's only a partial application
254 assert_raises(NotImplementedError, rec_eval, add2())
255
256 # add2(3) evaluates to 5 because we've filled in all the blanks
257 thing = rec_eval(add2(3))
258 print(thing)
259 assert thing == 5
260
261
262def test_callpipe():

Callers

nothing calls this directly

Calls 1

rec_evalFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…