code: def test_torchcript_invalid_method():
      """Test that an error is thrown with invalid torchscript method."""
      model = BoringModel()
      model.train(True)
  
      with pytest.raises(
          ValueError, match="only supports 'script' or 'trace'"
      ):
          model.to_torchscript(method="temp")
  
imports: import os
  import fsspec
  import pytest
  import torch
  from fsspec.implementations.local import LocalFileSystem
  from lightning.fabric.utilities.cloud_io import get_filesystem
  from lightning.pytorch.core.module import LightningModule
  from lightning.pytorch.demos.boring_classes import BoringModel
  from tests_pytorch.helpers.advanced_models import BasicGAN, ParityModuleRNN
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 9 for calling a global function with example usage: test_torchcript_invalid_method() without return types