Skip to content

Commit aa36078

Browse files
committed
Fix Black formatting in platform_utils tests
1 parent da350de commit aa36078

1 file changed

Lines changed: 35 additions & 13 deletions

File tree

tests/test_001_globals.py

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ def test_decimal_separator_with_db_operations(db_connection):
388388
try:
389389
# Create a test table with decimal values
390390
cursor = db_connection.cursor()
391-
cursor.execute("""
391+
cursor.execute(
392+
"""
392393
DROP TABLE IF EXISTS #decimal_separator_test;
393394
CREATE TABLE #decimal_separator_test (
394395
id INT,
@@ -399,7 +400,8 @@ def test_decimal_separator_with_db_operations(db_connection):
399400
(2, 678.90),
400401
(3, 0.01),
401402
(4, 999.99);
402-
""")
403+
"""
404+
)
403405
cursor.close()
404406

405407
# Test 1: Fetch with default separator
@@ -467,7 +469,8 @@ def test_decimal_separator_batch_operations(db_connection):
467469
try:
468470
# Create test data
469471
cursor = db_connection.cursor()
470-
cursor.execute("""
472+
cursor.execute(
473+
"""
471474
DROP TABLE IF EXISTS #decimal_batch_test;
472475
CREATE TABLE #decimal_batch_test (
473476
id INT,
@@ -478,7 +481,8 @@ def test_decimal_separator_batch_operations(db_connection):
478481
(1, 123.456, 12345.67890),
479482
(2, 0.001, 0.00001),
480483
(3, 999.999, 9999.99999);
481-
""")
484+
"""
485+
)
482486
cursor.close()
483487

484488
# Test 1: Fetch results with default separator
@@ -782,14 +786,18 @@ def test_windows_x64_detection(self):
782786
"""Test Windows x64 platform detection."""
783787
from unittest.mock import patch
784788

785-
with patch("mssql_python.platform_utils.sys") as mock_sys, \
786-
patch("mssql_python.platform_utils.os") as mock_os:
789+
with (
790+
patch("mssql_python.platform_utils.sys") as mock_sys,
791+
patch("mssql_python.platform_utils.os") as mock_os,
792+
):
787793
mock_sys.platform = "win32"
788794
mock_os.environ.get.return_value = "x64"
789795

790796
from mssql_python import platform_utils
797+
791798
# Force reimport to pick up mocked values
792799
import importlib
800+
793801
importlib.reload(platform_utils)
794802

795803
# Restore for actual test
@@ -840,7 +848,9 @@ def test_linux_x86_64_glibc_detection(self):
840848
with patch.object(platform_utils.sys, "platform", "linux"):
841849
with patch.object(platform_utils.os.environ, "get", return_value="x86_64"):
842850
with patch.object(platform_utils.platform, "machine", return_value="x86_64"):
843-
with patch.object(platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")):
851+
with patch.object(
852+
platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")
853+
):
844854
arch, tag = platform_utils.get_platform_info()
845855
assert arch == "x86_64"
846856
assert tag == "manylinux_2_28_x86_64"
@@ -853,7 +863,9 @@ def test_linux_x86_64_musl_detection(self):
853863
with patch.object(platform_utils.sys, "platform", "linux"):
854864
with patch.object(platform_utils.os.environ, "get", return_value="x86_64"):
855865
with patch.object(platform_utils.platform, "machine", return_value="x86_64"):
856-
with patch.object(platform_utils.platform, "libc_ver", return_value=("musl", "1.2")):
866+
with patch.object(
867+
platform_utils.platform, "libc_ver", return_value=("musl", "1.2")
868+
):
857869
arch, tag = platform_utils.get_platform_info()
858870
assert arch == "x86_64"
859871
assert tag == "musllinux_1_2_x86_64"
@@ -866,7 +878,9 @@ def test_linux_aarch64_glibc_detection(self):
866878
with patch.object(platform_utils.sys, "platform", "linux"):
867879
with patch.object(platform_utils.os.environ, "get", return_value="aarch64"):
868880
with patch.object(platform_utils.platform, "machine", return_value="aarch64"):
869-
with patch.object(platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")):
881+
with patch.object(
882+
platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")
883+
):
870884
arch, tag = platform_utils.get_platform_info()
871885
assert arch == "aarch64"
872886
assert tag == "manylinux_2_28_aarch64"
@@ -879,7 +893,9 @@ def test_linux_aarch64_musl_detection(self):
879893
with patch.object(platform_utils.sys, "platform", "linux"):
880894
with patch.object(platform_utils.os.environ, "get", return_value="aarch64"):
881895
with patch.object(platform_utils.platform, "machine", return_value="aarch64"):
882-
with patch.object(platform_utils.platform, "libc_ver", return_value=("musl", "1.2")):
896+
with patch.object(
897+
platform_utils.platform, "libc_ver", return_value=("musl", "1.2")
898+
):
883899
arch, tag = platform_utils.get_platform_info()
884900
assert arch == "aarch64"
885901
assert tag == "musllinux_1_2_aarch64"
@@ -892,7 +908,9 @@ def test_linux_arm64_alias(self):
892908
with patch.object(platform_utils.sys, "platform", "linux"):
893909
with patch.object(platform_utils.os.environ, "get", return_value="arm64"):
894910
with patch.object(platform_utils.platform, "machine", return_value="arm64"):
895-
with patch.object(platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")):
911+
with patch.object(
912+
platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")
913+
):
896914
arch, tag = platform_utils.get_platform_info()
897915
assert arch == "aarch64"
898916
assert tag == "manylinux_2_28_aarch64"
@@ -906,7 +924,9 @@ def test_linux_empty_libc_with_musl_glob(self):
906924
with patch.object(platform_utils.os.environ, "get", return_value="x86_64"):
907925
with patch.object(platform_utils.platform, "machine", return_value="x86_64"):
908926
with patch.object(platform_utils.platform, "libc_ver", return_value=("", "")):
909-
with patch.object(platform_utils.glob, "glob", return_value=["/lib/ld-musl-x86_64.so.1"]):
927+
with patch.object(
928+
platform_utils.glob, "glob", return_value=["/lib/ld-musl-x86_64.so.1"]
929+
):
910930
arch, tag = platform_utils.get_platform_info()
911931
assert arch == "x86_64"
912932
assert tag == "musllinux_1_2_x86_64"
@@ -936,7 +956,9 @@ def test_linux_unsupported_architecture(self):
936956
with patch.object(platform_utils.sys, "platform", "linux"):
937957
with patch.object(platform_utils.os.environ, "get", return_value="ppc64le"):
938958
with patch.object(platform_utils.platform, "machine", return_value="ppc64le"):
939-
with patch.object(platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")):
959+
with patch.object(
960+
platform_utils.platform, "libc_ver", return_value=("glibc", "2.28")
961+
):
940962
with pytest.raises(OSError) as exc_info:
941963
platform_utils.get_platform_info()
942964
assert "ppc64le" in str(exc_info.value)

0 commit comments

Comments
 (0)