@@ -657,6 +657,53 @@ def test_pytorch_gpu(specs):
657657 raise AssertionError ("No pytorch found" )
658658
659659
660+ def test_cross_platform_spinner_shows_target_platform (tmp_path : Path ) -> None :
661+ """
662+ https://github.com/conda/conda-libmamba-solver/pull/911
663+
664+ When ``subdirs`` is set to a non-host platform, the ``Platform:`` line of
665+ the metadata-collection spinner message should show the target platform,
666+ not the host platform, and must never show ``noarch``.
667+ """
668+ from conda .models .channel import Channel
669+
670+ target = "linux-64" if context .subdir != "linux-64" else "win-64"
671+ solver = Solver (
672+ prefix = tmp_path ,
673+ channels = ["conda-forge" ],
674+ subdirs = (target , "noarch" ),
675+ specs_to_add = ["tzdata" ],
676+ command = "create" ,
677+ )
678+ message = solver ._collect_all_metadata_spinner_message (
679+ channels = [Channel ("conda-forge" )]
680+ )
681+ assert f"Platform: { target } " in message
682+ assert "Platform: noarch" not in message
683+
684+
685+ def test_cross_platform_spinner_falls_back_when_only_noarch (tmp_path : Path ) -> None :
686+ """
687+ https://github.com/conda/conda-libmamba-solver/pull/911
688+
689+ If ``self.subdirs`` only contains ``noarch`` the spinner message must not
690+ raise ``StopIteration``; it should fall back to ``context.subdir``.
691+ """
692+ from conda .models .channel import Channel
693+
694+ solver = Solver (
695+ prefix = tmp_path ,
696+ channels = ["conda-forge" ],
697+ specs_to_add = ["tzdata" ],
698+ command = "create" ,
699+ )
700+ solver .subdirs = ("noarch" ,)
701+ message = solver ._collect_all_metadata_spinner_message (
702+ channels = [Channel ("conda-forge" )]
703+ )
704+ assert f"Platform: { context .subdir } " in message
705+
706+
660707def test_channel_subdir_set_correctly (tmp_env : TmpEnvFixture ) -> None :
661708 """
662709 https://github.com/conda/conda-libmamba-solver/issues/662
0 commit comments