Skip to content

Commit

Permalink
mock os.pathsep when running macOS tests on non-macOS systems
Browse files Browse the repository at this point in the history
  • Loading branch information
singingwolfboy committed Sep 29, 2023
1 parent 40f11de commit c0576fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
from pytest_mock import MockerFixture


@pytest.fixture(autouse=True)
def _fix_os_pathsep(mocker: MockerFixture) -> None:
"""
If we're not actually running on macOS, set `os.pathsep` to
what it should be on macOS.
"""
if sys.platform != "darwin":
mocker.patch("os.pathsep", ":")
mocker.patch("os.path.pathsep", ":")


@pytest.mark.parametrize(
"params",
[
Expand Down

0 comments on commit c0576fb

Please sign in to comment.