code: def test_get_timeline_info_negative_elapsed_time(
      capsys: _pytest.capture.CaptureFixture,
  ) -> None:
      # We need to reconstruct our default handler to properly capture stderr.
      optuna.logging._reset_library_root_logger()
      optuna.logging.enable_default_handler()
      optuna.logging.set_verbosity(optuna.logging.WARNING)
  
      study = _create_study_negative_elapsed_time()
      info = _get_timeline_info(study)
  
      _, err = capsys.readouterr()
      assert err != ""
  
      assert len(info.bars) == len(study.get_trials())
      for bar, trial in zip(info.bars, study.get_trials()):
          assert bar.number == trial.number
          assert bar.state == trial.state
          assert type(bar.hovertext) is str
          assert isinstance(bar.start, datetime.datetime)
          assert isinstance(bar.complete, datetime.datetime)
          assert bar.complete < bar.start
  
file_path: optuna/tests/visualization_tests/test_timeline.py
imports: from __future__ import annotations
  import datetime
  from io import BytesIO
  from typing import Any
  import _pytest.capture
  import pytest
  import optuna
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study.study import Study
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import go
  from optuna.visualization._timeline import _get_timeline_info
  from optuna.visualization._timeline import plot_timeline
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_timeline_info_negative_elapsed_time(capsys) without return types