code: def test_recarray_fromfile(self):
      import yatest.common as yc
  
      data_dir = yc.source_path(
          path.join(path.dirname(__file__), "data")
      )
      filename = path.join(data_dir, "recarray_from_file.fits")
      fd = open(filename, "rb")
      fd.seek(2880 * 2)
      r1 = np.rec.fromfile(
          fd, formats="f8,i4,a5", shape=3, byteorder="big"
      )
      fd.seek(2880 * 2)
      r2 = np.rec.array(
          fd, formats="f8,i4,a5", shape=3, byteorder="big"
      )
      fd.seek(2880 * 2)
      bytes_array = BytesIO()
      bytes_array.write(fd.read())
      bytes_array.seek(0)
      r3 = np.rec.fromfile(
          bytes_array, formats="f8,i4,a5", shape=3, byteorder="big"
      )
      fd.close()
      assert_equal(r1, r2)
      assert_equal(r2, r3)
  
imports: import collections.abc
  import textwrap
  from io import BytesIO
  from os import path
  from pathlib import Path
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises, temppath
  from numpy.compat import pickle
label_desc: Use image node_id 8 for calling the TestFromrecords obj's underlying member method code with example usage: obj.test_recarray_fromfile() without return types