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

Function test_truncate

numpy/polynomial/tests/test_classes.py:536–543  ·  view source on GitHub ↗
(Poly)

Source from the content-addressed store, hash-verified

534
535
536def test_truncate(Poly):
537 p = Poly([1, 2, 3])
538 assert_raises(ValueError, p.truncate, .5)
539 assert_raises(ValueError, p.truncate, 0)
540 assert_equal(len(p.truncate(4)), 3)
541 assert_equal(len(p.truncate(3)), 3)
542 assert_equal(len(p.truncate(2)), 2)
543 assert_equal(len(p.truncate(1)), 1)
544
545
546def test_trim(Poly):

Callers

nothing calls this directly

Calls 4

assert_raisesFunction · 0.90
assert_equalFunction · 0.90
PolyFunction · 0.85
truncateMethod · 0.80

Tested by

no test coverage detected