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

Method test_subclass

numpy/core/tests/test_function_base.py:356–364  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

354 assert_equal(linspace(a, b), linspace(0.0, 1.0))
355
356 def test_subclass(self):
357 a = array(0).view(PhysicalQuantity2)
358 b = array(1).view(PhysicalQuantity2)
359 ls = linspace(a, b)
360 assert type(ls) is PhysicalQuantity2
361 assert_equal(ls, linspace(0.0, 1.0))
362 ls = linspace(a, b, 1)
363 assert type(ls) is PhysicalQuantity2
364 assert_equal(ls, linspace(0.0, 1.0, 1))
365
366 def test_array_interface(self):
367 # 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