code: def _assert_error_on_write(df, exc, path=None, version=2):
      # check that we are raising the exception
      # on writing
  
      if path is None:
          path = random_path()
  
      TEST_FILES.append(path)
  
      def f():
          write_feather(df, path, version=version)
  
      pytest.raises(exc, f)
  
imports: import io
  import os
  import sys
  import tempfile
  import pytest
  import hypothesis
  import hypothesis.strategies
  import numpy
  import pyarrow
  import pyarrow.tests.strategies
  from pyarrow.feather import read_feather, write_feather, read_table, FeatherDataset
label_desc: Use image node_id 10 for calling a global function with example usage: _assert_error_on_write(df, exc, path, version) without return types