code: def test_download_from_url_error_creating_directory_with_env_var(
      logging_mock, mkdir_mock
  ):
      with pytest.raises(OSError):
          download_from_url("test_url")
      logging_mock.assert_called_with(
          "Failed creating cache direcotry at /test using path from 'DOCTR_CACHE_DIR' environment variable."
      )
  
file_path: doctr/tests/common/test_utils_data.py
imports: import os
  from pathlib import PosixPath
  from unittest.mock import patch
  import pytest
  from doctr.utils.data import download_from_url
label_desc: Use image node_id 4 for calling a global function with example usage: test_download_from_url_error_creating_directory_with_env_var(logging_mock, mkdir_mock) without return types