1212from unittest .mock import patch , MagicMock
1313from pathlib import Path
1414
15-
1615# =============================================================================
1716# platform_utils tests
1817# =============================================================================
@@ -248,24 +247,29 @@ class TestIsTruthy:
248247
249248 def test_bool_true (self ):
250249 from build_backend .hooks import _is_truthy
250+
251251 assert _is_truthy (True ) is True
252252
253253 def test_bool_false (self ):
254254 from build_backend .hooks import _is_truthy
255+
255256 assert _is_truthy (False ) is False
256257
257258 def test_string_true_variants (self ):
258259 from build_backend .hooks import _is_truthy
260+
259261 for val in ("true" , "True" , "TRUE" , "1" , "yes" , "Yes" , "YES" ):
260262 assert _is_truthy (val ) is True , f"Expected True for { val !r} "
261263
262264 def test_string_false_variants (self ):
263265 from build_backend .hooks import _is_truthy
266+
264267 for val in ("false" , "False" , "0" , "no" , "No" , "" , "anything" ):
265268 assert _is_truthy (val ) is False , f"Expected False for { val !r} "
266269
267270 def test_non_string_non_bool (self ):
268271 from build_backend .hooks import _is_truthy
272+
269273 assert _is_truthy (1 ) is True
270274 assert _is_truthy (0 ) is False
271275 assert _is_truthy ([]) is False
@@ -358,9 +362,7 @@ def test_build_editable_skip_compile(self, mock_compile):
358362
359363 mock_st_editable = MagicMock (return_value = "fake-editable.whl" )
360364 with patch ("setuptools.build_meta.build_editable" , mock_st_editable ):
361- result = build_editable (
362- "/tmp/out" , config_settings = {"--skip-ddbc-compile" : "true" }
363- )
365+ result = build_editable ("/tmp/out" , config_settings = {"--skip-ddbc-compile" : "true" })
364366
365367 mock_compile .assert_not_called ()
366368 assert result == "fake-editable.whl"
@@ -457,7 +459,9 @@ class TestCLI:
457459 """Tests for build_backend CLI entry point."""
458460
459461 @patch ("build_backend.__main__.compile_ddbc" )
460- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
462+ @patch (
463+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
464+ )
461465 def test_main_success (self , mock_plat , mock_compile ):
462466 from build_backend .__main__ import main
463467
@@ -466,23 +470,29 @@ def test_main_success(self, mock_plat, mock_compile):
466470 mock_compile .assert_called_once ()
467471
468472 @patch ("build_backend.__main__.compile_ddbc" , side_effect = FileNotFoundError ("no build.sh" ))
469- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
473+ @patch (
474+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
475+ )
470476 def test_main_file_not_found (self , mock_plat , mock_compile ):
471477 from build_backend .__main__ import main
472478
473479 with patch ("sys.argv" , ["build_backend" ]):
474480 assert main () == 1
475481
476482 @patch ("build_backend.__main__.compile_ddbc" , side_effect = RuntimeError ("failed" ))
477- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
483+ @patch (
484+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
485+ )
478486 def test_main_runtime_error (self , mock_plat , mock_compile ):
479487 from build_backend .__main__ import main
480488
481489 with patch ("sys.argv" , ["build_backend" ]):
482490 assert main () == 1
483491
484492 @patch ("build_backend.__main__.compile_ddbc" )
485- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
493+ @patch (
494+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
495+ )
486496 def test_main_quiet_suppresses_output (self , mock_plat , mock_compile , capsys ):
487497 from build_backend .__main__ import main
488498
@@ -492,7 +502,9 @@ def test_main_quiet_suppresses_output(self, mock_plat, mock_compile, capsys):
492502 assert "[build_backend]" not in captured .out
493503
494504 @patch ("build_backend.__main__.compile_ddbc" )
495- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
505+ @patch (
506+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
507+ )
496508 def test_main_passes_arch (self , mock_plat , mock_compile ):
497509 from build_backend .__main__ import main
498510
@@ -501,7 +513,9 @@ def test_main_passes_arch(self, mock_plat, mock_compile):
501513 mock_compile .assert_called_once_with (arch = "arm64" , coverage = False , verbose = False )
502514
503515 @patch ("build_backend.__main__.compile_ddbc" )
504- @patch ("build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
516+ @patch (
517+ "build_backend.__main__.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
518+ )
505519 def test_main_passes_coverage (self , mock_plat , mock_compile ):
506520 from build_backend .__main__ import main
507521
@@ -589,7 +603,9 @@ class TestCompileDdbc:
589603
590604 @patch ("build_backend.compiler._run_unix_build" , return_value = True )
591605 @patch ("build_backend.compiler.find_pybind_dir" , return_value = Path ("/fake/pybind" ))
592- @patch ("build_backend.compiler.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" ))
606+ @patch (
607+ "build_backend.compiler.get_platform_info" , return_value = ("x86_64" , "manylinux_2_28_x86_64" )
608+ )
593609 def test_compile_ddbc_linux_default_arch (self , mock_plat , mock_find , mock_unix ):
594610 """compile_ddbc uses get_platform_info when arch is None."""
595611 from build_backend .compiler import compile_ddbc
0 commit comments