code: def test_deprecation_raises_error_for_invalid_version(
      deprecated_version: Any, removed_version: Any
  ) -> None:
      with pytest.raises(ValueError):
          _deprecated.deprecated_func(
              deprecated_version, removed_version
          )
  
      with pytest.raises(ValueError):
          _deprecated.deprecated_class(
              deprecated_version, removed_version
          )
  
file_path: optuna/tests/test_deprecated.py
imports: from typing import Any
  from typing import Optional
  import pytest
  from optuna import _deprecated
label_desc: Use image node_id 1 for calling a global function with example usage: test_deprecation_raises_error_for_invalid_version(deprecated_version, removed_version) without return types