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

Function test_cutdeg

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

Source from the content-addressed store, hash-verified

524
525
526def test_cutdeg(Poly):
527 p = Poly([1, 2, 3])
528 assert_raises(ValueError, p.cutdeg, .5)
529 assert_raises(ValueError, p.cutdeg, -1)
530 assert_equal(len(p.cutdeg(3)), 3)
531 assert_equal(len(p.cutdeg(2)), 3)
532 assert_equal(len(p.cutdeg(1)), 2)
533 assert_equal(len(p.cutdeg(0)), 1)
534
535
536def test_truncate(Poly):

Callers

nothing calls this directly

Calls 4

assert_raisesFunction · 0.90
assert_equalFunction · 0.90
PolyFunction · 0.85
cutdegMethod · 0.80

Tested by

no test coverage detected