code: def test_polyint(self):
      # check exceptions
      assert_raises(TypeError, poly.polyint, [0], 0.5)
      assert_raises(ValueError, poly.polyint, [0], -1)
      assert_raises(ValueError, poly.polyint, [0], 1, [0, 0])
      assert_raises(ValueError, poly.polyint, [0], lbnd=[0])
      assert_raises(ValueError, poly.polyint, [0], scl=[0])
      assert_raises(TypeError, poly.polyint, [0], axis=0.5)
      assert_raises(TypeError, poly.polyint, [1, 1], 1.0)
  
      # test integration of zero polynomial
      for i in range(2, 5):
          k = [0] * (i - 2) + [1]
          res = poly.polyint([0], m=i, k=k)
          assert_almost_equal(res, [0, 1])
  
      # check single integration with integration constant
      for i in range(5):
          scl = i + 1
          pol = [0] * i + [1]
          tgt = [i] + [0] * i + [1 / scl]
          res = poly.polyint(pol, m=1, k=[i])
          assert_almost_equal(trim(res), trim(tgt))
  
      # check single integration with integration constant and lbnd
      for i in range(5):
          scl = i + 1
          pol = [0] * i + [1]
          res = poly.polyint(pol, m=1, k=[i], lbnd=-1)
          assert_almost_equal(poly.polyval(-1, res), i)
  
      # check single integration with integration constant and scaling
      for i in range(5):
          scl = i + 1
          pol = [0] * i + [1]
          tgt = [i] + [0] * i + [2 / scl]
          res = poly.polyint(pol, m=1, k=[i], scl=2)
          assert_almost_equal(trim(res), trim(tgt))
  
      # check multiple integrations with default k
      for i in range(5):
          for j in range(2, 5):
              pol = [0] * i + [1]
              tgt = pol[:]
              for k in range(j):
                  tgt = poly.polyint(tgt, m=1)
              res = poly.polyint(pol, m=j)
              assert_almost_equal(trim(res), trim(tgt))
  
      # check multiple integrations with defined k
      for i in range(5):
          for j in range(2, 5):
              pol = [0] * i + [1]
              tgt = pol[:]
              for k in range(j):
                  tgt = poly.polyint(tgt, m=1, k=[k])
              res = poly.polyint(pol, m=j, k=list(range(j)))
              assert_almost_equal(trim(res), trim(tgt))
  
      # check multiple integrations with lbnd
      for i in range(5):
          for j in range(2, 5):
              pol = [0] * i + [1]
              tgt = pol[:]
              for k in range(j):
                  tgt = poly.polyint(tgt, m=1, k=[k], lbnd=-1)
              res = poly.polyint(pol, m=j, k=list(range(j)), lbnd=-1)
              assert_almost_equal(trim(res), trim(tgt))
  
      # check multiple integrations with scaling
      for i in range(5):
          for j in range(2, 5):
              pol = [0] * i + [1]
              tgt = pol[:]
              for k in range(j):
                  tgt = poly.polyint(tgt, m=1, k=[k], scl=2)
              res = poly.polyint(pol, m=j, k=list(range(j)), scl=2)
              assert_almost_equal(trim(res), trim(tgt))
  
imports: from functools import reduce
  from fractions import Fraction
  import numpy
  import numpy.polynomial.polynomial
  import pickle
  from copy import deepcopy
  from numpy.testing import assert_almost_equal, assert_raises, assert_equal, assert_, assert_array_equal, assert_raises_regex
label_desc: Use image node_id 1 for calling the TestIntegral obj's underlying member method code with example usage: obj.test_polyint() without return types