Skip to content

Commit

Permalink
Unskip tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
john-kurkowski committed Mar 15, 2024
1 parent 7f5936c commit 9f6a530
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
12 changes: 6 additions & 6 deletions tests/__snapshots__/test_release.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
list([
'rm',
'-rf',
PosixPath('dist'),
'dist',
]),
),
dict({
Expand All @@ -145,7 +145,7 @@
list([
'ls',
'-l',
PosixPath('dist'),
'dist',
]),
),
dict({
Expand All @@ -158,7 +158,7 @@
list([
'tar',
'tvf',
PosixPath('dist/archive1'),
'dist/archive1',
]),
),
dict({
Expand All @@ -171,7 +171,7 @@
list([
'tar',
'tvf',
PosixPath('dist/archive2'),
'dist/archive2',
]),
),
dict({
Expand All @@ -184,7 +184,7 @@
list([
'tar',
'tvf',
PosixPath('dist/archive3'),
'dist/archive3',
]),
),
dict({
Expand All @@ -199,7 +199,7 @@
'upload',
'--repository',
'testpypi',
PosixPath('dist/*'),
'dist/*',
]),
),
dict({
Expand Down
18 changes: 14 additions & 4 deletions tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
from __future__ import annotations

import dataclasses
import sys
from collections.abc import Iterator
from pathlib import Path
from typing import Any
from unittest import mock

import pytest
from syrupy.assertion import SnapshotAssertion
from syrupy.matchers import path_type

from scripts import release

Expand Down Expand Up @@ -47,9 +48,18 @@ def mocks() -> Iterator[Mocks]:
)


@pytest.mark.skipif(
sys.platform == "win32", reason="Snapshot paths are different on Windows"
)
@pytest.fixture
def snapshot(snapshot: SnapshotAssertion) -> SnapshotAssertion:
"""Override syrupy's snapshot.
* Simplify platform-dependent `Path` serialization, so the same snapshot
works on multiple platforms.
"""
return snapshot.with_defaults(
matcher=path_type(types=(Path,), replacer=lambda data, _: str(data))
)


def test_happy_path(
capsys: pytest.CaptureFixture[str],
mocks: Mocks,
Expand Down

0 comments on commit 9f6a530

Please sign in to comment.