|
5 | 5 | from __future__ import annotations |
6 | 6 |
|
7 | 7 | import os |
| 8 | +import sys |
8 | 9 | import tempfile |
9 | 10 | from pathlib import Path |
10 | 11 | from unittest.mock import MagicMock, patch, mock_open |
11 | 12 |
|
12 | 13 | import pytest |
13 | 14 |
|
| 15 | +# Skip marker for Windows (Unix-style paths and PATH separator differences) |
| 16 | +skip_on_windows = pytest.mark.skipif( |
| 17 | + sys.platform == "win32", |
| 18 | + reason="Uses Unix-style paths and PATH separator (:)" |
| 19 | +) |
| 20 | + |
14 | 21 | from cli_audit.reconcile import ( |
15 | 22 | Installation, |
16 | 23 | ReconciliationResult, |
@@ -124,6 +131,7 @@ def test_classify_via_path_unknown(self): |
124 | 131 | class TestDetectInstallations: |
125 | 132 | """Tests for installation detection.""" |
126 | 133 |
|
| 134 | + @skip_on_windows |
127 | 135 | @patch("cli_audit.reconcile.validate_installation") |
128 | 136 | @patch("cli_audit.reconcile.shutil.which") |
129 | 137 | @patch("os.path.exists") |
@@ -163,6 +171,7 @@ def exists_side_effect(path): |
163 | 171 | assert installations[0].version == "14.1.0" |
164 | 172 | assert installations[0].active is True |
165 | 173 |
|
| 174 | + @skip_on_windows |
166 | 175 | @patch("cli_audit.reconcile.validate_installation") |
167 | 176 | @patch("cli_audit.reconcile.shutil.which") |
168 | 177 | @patch("os.path.exists") |
@@ -543,6 +552,7 @@ def reconcile_side_effect(tool, *args, **kwargs): |
543 | 552 | class TestPathVerification: |
544 | 553 | """Tests for PATH verification.""" |
545 | 554 |
|
| 555 | + @skip_on_windows |
546 | 556 | def test_verify_path_ordering_correct(self, monkeypatch): |
547 | 557 | """Test PATH ordering when correct.""" |
548 | 558 | monkeypatch.setenv("PATH", "/home/user/.cargo/bin:/home/user/.local/bin:/usr/local/bin:/usr/bin") |
@@ -574,6 +584,7 @@ def expand_side_effect(path): |
574 | 584 | issues = verify_path_ordering() |
575 | 585 | assert len(issues) == 0 |
576 | 586 |
|
| 587 | + @skip_on_windows |
577 | 588 | def test_verify_path_ordering_incorrect(self, monkeypatch): |
578 | 589 | """Test PATH ordering when incorrect.""" |
579 | 590 | monkeypatch.setenv("PATH", "/usr/bin:/home/user/.cargo/bin") |
|
0 commit comments