diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index f983c65b..77189dab 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -821,7 +821,6 @@ class Options: test_runtime_str = self.reader.get( "test-runtime", - env_plat=False, option_format=ShlexTableFormat(sep="; ", pair_sep=":", allow_merge=False), ) if not test_runtime_str: diff --git a/unit_test/options_test.py b/unit_test/options_test.py index f8c7b643..596ad27d 100644 --- a/unit_test/options_test.py +++ b/unit_test/options_test.py @@ -832,6 +832,31 @@ def test_test_runtime_handling( assert local.test_runtime.args == expected_args +@pytest.mark.parametrize( + ("platform", "platform_envvar"), + [ + ("android", "CIBW_TEST_RUNTIME_ANDROID"), + ("ios", "CIBW_TEST_RUNTIME_IOS"), + ], +) +def test_test_runtime_platform_environment( + tmp_path: Path, platform: PlatformName, platform_envvar: str +) -> None: + args = CommandLineArguments.defaults() + args.package_dir = tmp_path + + options = Options( + platform=platform, + command_line_arguments=args, + env={ + "CIBW_TEST_RUNTIME": "args: --global", + platform_envvar: "args: --platform-specific", + }, + ) + + assert options.build_options(None).test_runtime.args == ["--platform-specific"] + + @pytest.mark.parametrize( ("definition", "expected"), [