code: def test_random_with_data_rvs(self):
      if self.random_method == "rand":
          pytest.skip(
              "cupyx.scipy.sparse.rand does not support data_rvs"
          )
      data_rvs = mock.MagicMock(side_effect=cupy.zeros)
      x = getattr(sparse, self.random_method)(
          3,
          4,
          density=0.1,
          data_rvs=data_rvs,
          format=self.format,
          dtype=self.dtype,
      )
      assert x.shape == (3, 4)
      assert x.dtype == self.dtype
      assert x.format == self.format
  
      assert data_rvs.call_count == 1
      # Note that its value is generated randomly
      assert isinstance(data_rvs.call_args[0][0], int)
  
imports: import functools
  import re
  from unittest import mock
  import numpy
  import pytest
  import cupy
  from cupy import testing
  from cupy.cuda import runtime
  from cupyx.scipy import sparse
  from cupyx.scipy.sparse import _construct
label_desc: Use image node_id 4 for calling the TestRandom obj's underlying member method code with example usage: obj.test_random_with_data_rvs() without return types