code: def test_timeout(case: TimeoutParams):
      composer_params = {
          "max_depth": 1,
          "max_arity": 1,
          "pop_size": 2,
          "with_tuning": False,
          "genetic_scheme": GeneticSchemeTypesEnum.generational,
          "num_of_generations": case.test_input["num_of_generations"],
      }
  
      task_type = "ts_forecasting"
      fedot_input = {
          "problem": task_type,
          "seed": 42,
          "preset": "fast_train",
          "logging_level": logging.DEBUG,
          "timeout": case.test_input["timeout"],
          "task_params": TsForecastingParams(forecast_length=1),
          **composer_params,
      }
  
      train_data, _, _ = get_dataset(task_type)
      if isinstance(case.test_answer, ValueError):
          with pytest.raises(ValueError):
              Fedot(**fedot_input)
      else:
          auto_model = Fedot(**fedot_input)
          auto_model.fit(features=train_data, target="target")
          history: OptHistory = auto_model.history
          assert case.test_answer(history)
  
file_path: FEDOT/test/integration/api_params/test_main_api_params.py
imports: import logging
  from dataclasses import dataclass
  from typing import Callable, Union
  import pytest
  from golem.core.optimisers.genetic.operators.inheritance import GeneticSchemeTypesEnum
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from fedot import Fedot
  from fedot.core.repository.tasks import TsForecastingParams
  from test.integration.api.test_main_api import get_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_timeout(case) without return types