class_docstr: Test :meth:`orion.client.get_experiment`
class_docstr_tok: ["Test",":","meth",":","`","orion.client.get_experiment","`"]
docstr: Tests that a warning is printed when the experiment exist but the version doesn't
docstr_tok: ["Tests","that","a","warning","is","printed","when","the","experiment","exist","but","the","version","does","n't"]
code: def test_version_do_not_exist(self, caplog, mock_database):
      """Tests that a warning is printed when the experiment exist but the version doesn't"""
      create_experiment(
          "a",
          space={"x": "uniform(0, 10)"},
          storage=mock_database.storage,
      )
  
      experiment = get_experiment("a", 2, storage=mock_database.storage)
  
      assert experiment.version == 1
      assert (
          "Version 2 was specified but most recent version is only 1. Using 1."
          in caplog.text
      )
  
imports: import copy
  import json
  from importlib import reload
  import pytest
  import orion.client
  import orion.client.cli
  import orion.core
  from orion.algo.random import Random
  from orion.client import get_experiment
  from orion.client.experiment import ExperimentClient
  from orion.core.io.database.ephemeraldb import EphemeralDB
  from orion.core.io.database.pickleddb import PickledDB
  from orion.core.utils.exceptions import BranchingEvent, NoConfigurationError, RaceCondition, UnsupportedOperation
  from orion.storage.base import setup_storage
  from orion.storage.legacy import Legacy
  from orion.testing import OrionState
label_desc: Use image node_id 3 for calling the TestGetExperiment obj's underlying member method code with example usage: obj.test_version_do_not_exist(caplog, mock_database) without return types