code: def test_asarray_chkfinite_non_finite_vals(self, dtype, order):
      a = [-numpy.inf, 0.0, numpy.inf, numpy.nan]
      for xp in (numpy, cupy):
          if xp.issubdtype(dtype, xp.integer):
              error = OverflowError
          else:
              error = ValueError
          with pytest.raises(error):
              xp.asarray_chkfinite(a, dtype=dtype, order=order)
  
imports: import unittest
  import pytest
  import numpy
  import cupy
  from cupy import testing
label_desc: Use image node_id 2 for calling the TestKind obj's underlying member method code with example usage: obj.test_asarray_chkfinite_non_finite_vals(dtype, order) without return types