MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / test_ufunc

Method test_ufunc

tests/cloudpickle_test.py:457–471  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

455 reason="Skip numpy and scipy tests on PyPy",
456 )
457 def test_ufunc(self):
458 # test a numpy ufunc (universal function), which is a C-based function
459 # that is applied on a numpy array
460
461 if np:
462 # simple ufunc: np.add
463 self.assertEqual(pickle_depickle(np.add, protocol=self.protocol), np.add)
464 else: # skip if numpy is not available
465 pass
466
467 if spp:
468 # custom ufunc: scipy.special.iv
469 self.assertEqual(pickle_depickle(spp.iv, protocol=self.protocol), spp.iv)
470 else: # skip if scipy is not available
471 pass
472
473 def test_loads_namespace(self):
474 obj = 1, 2, 3, 4

Callers

nothing calls this directly

Calls 1

pickle_depickleFunction · 0.85

Tested by

no test coverage detected