Files
litellm/tests/windows_tests/test_litellm_on_windows.py
T
Ishaan Jaff 7c4fae477a [Bug Fix] UnicodeDecodeError: 'charmap' on Windows during litellm import (#10542)
* test using litellm on windows

* fix using litellm on windows

* test using litellm on windows

* fix change on ci/cd

* fix test on ci/cd
2025-05-03 21:31:05 -07:00

36 lines
906 B
Python

import asyncio
import os
import subprocess
import sys
import time
import traceback
import platform
import pytest
sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system path
def test_using_litellm_on_windows():
"""Test that LiteLLM can be imported on Windows systems."""
try:
import litellm
print(f"litellm imported successfully on Windows ({platform.system()} {platform.release()})")
response = litellm.completion(
model="gpt-4o",
messages=[
{"role": "user", "content": "This should never fail. Email ishaan@berri.ai if this test ever fails."}
],
mock_response="Hello, how are you?"
)
print(response)
except Exception as e:
pytest.fail(
f"Error occurred on Windows: {e}. Installing litellm on Windows failed."
)