3636from __future__ import annotations
3737
3838import hashlib
39+ import sys
3940from datetime import UTC , datetime
4041from pathlib import Path
4142
@@ -1290,6 +1291,7 @@ def test_macos_arm64_not_mac64_m1(self) -> None:
12901291# ---------------------------------------------------------------------------
12911292
12921293
1294+ @pytest .mark .skipif (sys .platform != "win32" , reason = "Edge system detection tests require Windows" )
12931295class TestBug56EdgeForceRemovesOldEntry :
12941296 """Bug 56: Edge installer must remove old registry entry on force reinstall.
12951297
@@ -1360,6 +1362,7 @@ async def fake_install_windows(resolved_ver, force_flag):
13601362 assert result .version == "131.0.0.0"
13611363
13621364
1365+ @pytest .mark .skipif (sys .platform != "win32" , reason = "Edge system detection tests require Windows" )
13631366class TestBug57EdgeForceRemovesAllStaleEntries :
13641367 """Bug 57: Edge installer force=True must remove ALL stale entries.
13651368
@@ -1549,7 +1552,7 @@ class TestBug59NoPrematureDeletion:
15491552 installation but the registry still pointed to the now-deleted path.
15501553 """
15511554
1552- def test_firefox_install_preserves_dir_on_download_failure (self ) -> None :
1555+ def test_firefox_install_preserves_dir_on_download_failure (self , tmp_path : Path ) -> None :
15531556 """Firefox installer must not remove old dir before download."""
15541557 from unittest .mock import AsyncMock , MagicMock , patch
15551558
@@ -1562,12 +1565,12 @@ def test_firefox_install_preserves_dir_on_download_failure(self) -> None:
15621565 registry .find .return_value = InstalledArtifact (
15631566 name = "firefox" ,
15641567 version = "131.0" ,
1565- path = Path ( "/fake/ firefox/ 131.0") ,
1568+ path = tmp_path / " firefox" / " 131.0" ,
15661569 installed_at = datetime .now (UTC ),
15671570 checksum = None ,
15681571 )
15691572
1570- config = Config (cache_dir = Path ( "/fake/ cache") )
1573+ config = Config (cache_dir = tmp_path / " cache" )
15711574 http = MagicMock (spec = HttpClient )
15721575 http .download = AsyncMock (side_effect = RuntimeError ("download failed" ))
15731576 installer = FirefoxInstaller (http , registry , config )
@@ -1587,8 +1590,8 @@ def test_firefox_install_preserves_dir_on_download_failure(self) -> None:
15871590 patch ("browserget.installers.firefox.get_download_dir" ) as mock_download_dir ,
15881591 patch ("browserget.installers.firefox.safe_download_path" ) as mock_safe_dl ,
15891592 ):
1590- mock_download_dir .return_value = Path ( "/fake/ downloads")
1591- mock_safe_dl .return_value = Path ( "/fake/ downloads/ firefox.exe")
1593+ mock_download_dir .return_value = tmp_path / " downloads"
1594+ mock_safe_dl .return_value = tmp_path / " downloads" / " firefox.exe"
15921595
15931596 import asyncio
15941597
@@ -1598,7 +1601,7 @@ def test_firefox_install_preserves_dir_on_download_failure(self) -> None:
15981601 # safe_rmtree must NOT be called before the download succeeds
15991602 mock_rmtree .assert_not_called ()
16001603
1601- def test_chrome_install_preserves_dir_on_download_failure (self ) -> None :
1604+ def test_chrome_install_preserves_dir_on_download_failure (self , tmp_path : Path ) -> None :
16021605 """Chrome installer must not remove old dir before download."""
16031606 from unittest .mock import AsyncMock , MagicMock , patch
16041607
@@ -1611,12 +1614,12 @@ def test_chrome_install_preserves_dir_on_download_failure(self) -> None:
16111614 registry .find .return_value = InstalledArtifact (
16121615 name = "chrome" ,
16131616 version = "131.0.6778.87" ,
1614- path = Path ( "/fake/ chrome/ 131.0.6778.87") ,
1617+ path = tmp_path / " chrome" / " 131.0.6778.87" ,
16151618 installed_at = datetime .now (UTC ),
16161619 checksum = None ,
16171620 )
16181621
1619- config = Config (cache_dir = Path ( "/fake/ cache") )
1622+ config = Config (cache_dir = tmp_path / " cache" )
16201623 http = MagicMock (spec = HttpClient )
16211624 http .download = AsyncMock (side_effect = RuntimeError ("download failed" ))
16221625 installer = ChromeInstaller (http , registry , config )
@@ -1636,8 +1639,8 @@ def test_chrome_install_preserves_dir_on_download_failure(self) -> None:
16361639 patch ("browserget.installers.chrome.get_download_dir" ) as mock_download_dir ,
16371640 patch ("browserget.installers.chrome.safe_download_path" ) as mock_safe_dl ,
16381641 ):
1639- mock_download_dir .return_value = Path ( "/fake/ downloads")
1640- mock_safe_dl .return_value = Path ( "/fake/ downloads/ chrome.zip")
1642+ mock_download_dir .return_value = tmp_path / " downloads"
1643+ mock_safe_dl .return_value = tmp_path / " downloads" / " chrome.zip"
16411644
16421645 import asyncio
16431646
@@ -1654,6 +1657,7 @@ def test_chrome_install_preserves_dir_on_download_failure(self) -> None:
16541657# ---------------------------------------------------------------------------
16551658
16561659
1660+ @pytest .mark .skipif (sys .platform != "win32" , reason = "Edge system detection tests require Windows" )
16571661class TestBug60EdgeNoPrematureRegistryCleanup :
16581662 """Tests that the Edge installer does not remove registry entries before
16591663 the installation succeeds when force=True.
0 commit comments