MCPcopy
hub / github.com/numpy/numpy / test_subclass

Method test_subclass

numpy/_core/tests/test_function_base.py:392–400  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

390 assert_equal(linspace(a, b), linspace(0.0, 1.0))
391
392 def test_subclass(self):
393 a = array(0).view(PhysicalQuantity2)
394 b = array(1).view(PhysicalQuantity2)
395 ls = linspace(a, b)
396 assert type(ls) is PhysicalQuantity2
397 assert_equal(ls, linspace(0.0, 1.0))
398 ls = linspace(a, b, 1)
399 assert type(ls) is PhysicalQuantity2
400 assert_equal(ls, linspace(0.0, 1.0, 1))
401
402 def test_array_interface(self):
403 # Regression test for https://github.com/numpy/numpy/pull/6659

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
linspaceFunction · 0.90
assert_equalFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected