MCPcopy Create free account
hub / github.com/numpy/numpy / test_keywords

Method test_keywords

numpy/lib/tests/test_function_base.py:1405–1417  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1403 assert_array_almost_equal(r1, r2)
1404
1405 def test_keywords(self):
1406
1407 def foo(a, b=1):
1408 return a + b
1409
1410 f = vectorize(foo)
1411 args = np.array([1, 2, 3])
1412 r1 = f(args)
1413 r2 = np.array([2, 3, 4])
1414 assert_array_equal(r1, r2)
1415 r1 = f(args, 2)
1416 r2 = np.array([3, 4, 5])
1417 assert_array_equal(r1, r2)
1418
1419 def test_keywords_with_otypes_order1(self):
1420 # gh-1620: The second call of f would crash with

Callers

nothing calls this directly

Calls 3

vectorizeClass · 0.90
assert_array_equalFunction · 0.90
fFunction · 0.85

Tested by

no test coverage detected