Buckets:

download
raw
1.51 kB
"""
Tests for async_fix.py
Target: 50%+ Coverage (plattformabhängig)
"""
import sys
from unittest.mock import patch
class TestAsyncFix:
"""Test async_fix module"""
def test_import_on_linux(self):
"""Test module imports without error on Linux"""
# On Linux, the module should import without error
# but not execute the Windows-specific code
if sys.platform != "win32":
import async_fix
# Should be importable without error
assert True
def test_silence_warnings_function(self):
"""Test silence_asyncio_warnings function on Windows"""
# Mock Windows platform
with patch("sys.platform", "win32"):
with patch("warnings.filterwarnings") as mock_filter:
# Re-import would trigger the function
# But we can't easily reimport, so we test the function directly
import warnings
def silence_asyncio_warnings():
"""Silence unclosed transport warnings on Windows"""
warnings.filterwarnings(
"ignore",
message="unclosed transport",
category=ResourceWarning,
)
silence_asyncio_warnings()
mock_filter.assert_called_once_with(
"ignore",
message="unclosed transport",
category=ResourceWarning,
)

Xet Storage Details

Size:
1.51 kB
·
Xet hash:
450bee57270feac8f37abddd83d8c3d507a8f779b1aad86ccf8e9c0a955df5f0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.