code: def test_study_add_observation_same_iteration_twice():
      s = get_mock_study()
      t = s.get_suggestion()
      s.add_observation(
          trial=t,
          objective=0.1,
          context={"other_metrics": 0.2},
          iteration=1,
      )
      with pytest.raises(ValueError):
          s.add_observation(
              trial=t,
              objective=0.1,
              context={"other_metrics": 0.2},
              iteration=1,
          )
  
file_path: sherpa/tests/test_study.py
imports: import pytest
  import sherpa
  import sherpa.core
  import sherpa.schedulers
  import sherpa.database
  import pandas
  import collections
  from testing_utils import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_study_add_observation_same_iteration_twice() without return types