class_docstr: Base class for testing Profet tasks.
class_docstr_tok: ["Base","class","for","testing","Profet","tasks","."]
docstr: Simple test: Check that a task can be created and that its attributes are used and set
  correctly.
docstr_tok: ["Simple","test",":","Check","that","a","task","can","be","created","and","that","its","attributes","are","used","and","set","correctly","."]
code: def test_attributes(
      self,
      profet_train_config: MetaModelConfig,
      checkpoint_dir: Path,
      profet_input_dir: Path,
      device_str: str,
      tmp_path_factory,
  ):
      """Simple test: Check that a task can be created and that its attributes are used and set
      correctly.
      """
      max_trials = 123
      device = torch.device(device_str)
      task = self.Task(
          max_trials=max_trials,
          model_config=profet_train_config,
          input_dir=profet_input_dir,
          checkpoint_dir=checkpoint_dir,
          device=device,
      )
      assert task.max_trials == max_trials
      assert task.input_dir == profet_input_dir
      assert task.checkpoint_dir == checkpoint_dir
      assert isinstance(task.device, torch.device)
      assert task.device == device
      assert task.device.type == device_str
      # NOTE: The class attributes might differ per task, but that's ok.
      assert isinstance(task.model_config, self.Task.ModelConfig)
      assert asdict(task.model_config) == asdict(profet_train_config)
  
imports: from dataclasses import asdict, replace
  from logging import getLogger
  from pathlib import Path
  from typing import ClassVar, Type
  import numpy
  import pytest
  from _pytest.tmpdir import TempPathFactory
  from orion.algo.space import Space
  from typing import List, Union, overload
  from pytest_mock import MockerFixture
  from orion.benchmark.task.profet.profet_task import MetaModelConfig, ProfetTask
  from orion.core.worker.trial import Trial
  from .conftest import REAL_PROFET_DATA_DIR, is_nonempty_dir
label_desc: Use image node_id 4 for calling the ProfetTaskTests obj's underlying member method code with example usage: obj.test_attributes(profet_train_config, checkpoint_dir, profet_input_dir, device_str, tmp_path_factory) without return types