code: def test_get_latest_version__timeout(mocker: MockerFixture) -> None:
      mocker.patch.dict(
          os.environ, {"LIGHTLY_SERVER_LOCATION": "invalid-url"}
      )
      start = time.perf_counter()
      with pytest.raises(MaxRetryError):
          # Urllib3 raises a timeout error (connection refused) for invalid URLs.
          _version_checking.get_latest_version("1.2.8", timeout_sec=0.1)
      end = time.perf_counter()
      assert end - start < 0.2
  
file_path: lightly/tests/api/test_version_checking.py
imports: import os
  import time
  import pytest
  from pytest_mock import MockerFixture
  from urllib3.exceptions import MaxRetryError
  from lightly.api import _version_checking
  from lightly.openapi_generated.swagger_client.api import VersioningApi
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_latest_version__timeout(mocker) without return types