From d64c936b7b2e67d40d3119630693d6028489b041 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 4 Mar 2024 15:07:03 +0000 Subject: [PATCH] Reformat `path_separator`'s decorator --- coincidence/fixtures.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/coincidence/fixtures.py b/coincidence/fixtures.py index bb73e00..4482186 100644 --- a/coincidence/fixtures.py +++ b/coincidence/fixtures.py @@ -105,20 +105,14 @@ def fixed_datetime(monkeypatch) -> Iterator: yield +_skip_forward_mark = pytest.mark.skipif(os.sep == '\\', reason=r"Output differs on platforms where os.sep == '\\'") +_skip_backward_mark = pytest.mark.skipif(os.sep == '/', reason="Output differs on platforms where os.sep == '/'") + + @pytest.fixture( params=[ - pytest.param( - '/', - id="forward", - marks=pytest.mark. - skipif(os.sep == '\\', reason=r"Output differs on platforms where os.sep == '\\'") - ), - pytest.param( - '\\', - id="backward", - marks=pytest.mark. - skipif(os.sep == '/', reason="Output differs on platforms where os.sep == '/'") - ), + pytest.param('/', id="forward", marks=_skip_forward_mark), + pytest.param('\\', id="backward", marks=_skip_backward_mark), ] ) def path_separator(request) -> str: