code: def test_savefun_and_writer_exclusive(self):
      # savefun and writer arguments cannot be specified together.
      def savefun(*args, **kwargs):
          assert False
  
      writer = extensions.snapshot_writers.SimpleWriter()
      with pytest.raises(TypeError):
          extensions.snapshot(savefun=savefun, writer=writer)
  
      trainer = mock.MagicMock()
      with pytest.raises(TypeError):
          extensions.snapshot_object(
              trainer, savefun=savefun, writer=writer
          )
  
imports: import glob
  import itertools
  import os
  import shutil
  import tempfile
  import time
  import unittest
  import mock
  import pytest
  from chainer import testing
  from chainer import training
  from chainer.training import extensions
  from chainer.training.extensions._snapshot import _find_latest_snapshot
  from chainer.training.extensions._snapshot import _find_snapshot_files
  from chainer.training.extensions._snapshot import _find_stale_snapshots
label_desc: Use image node_id 2 for calling the TestSnapshot obj's underlying member method code with example usage: obj.test_savefun_and_writer_exclusive() without return types