Skip to content

Commit

Permalink
Exclude absolute paths from result/tail test
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Feb 23, 2024
1 parent ec3ff5f commit 1c9abb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion snakebids/tests/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def paths(
) -> st.SearchStrategy[Path]:
valid_chars = st.characters(blacklist_characters=["/", "\x00"], codec="UTF-8")
paths = st.lists(
st.text(valid_chars), min_size=min_segments, max_size=max_segments
st.text(valid_chars, min_size=1), min_size=min_segments, max_size=max_segments
).map(lambda x: Path(*x))

relative_paths = paths.filter(lambda p: not p.is_absolute())
Expand Down
3 changes: 1 addition & 2 deletions snakebids/tests/test_plugins/test_snakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pytest
from hypothesis import given
from hypothesis import strategies as st
from pathvalidate import Platform, is_valid_filepath
from pytest_mock import MockerFixture
from pytest_mock.plugin import MockType

Expand Down Expand Up @@ -250,7 +249,7 @@ def test_output_in_app_triggers_workflow_mode(
root=Path("results"),
)

@given(tail=st.text().filter(lambda s: is_valid_filepath(s, Platform.LINUX)))
@given(tail=sb_st.paths(absolute=False))
@allow_function_scoped
def test_output_under_results_triggers_workflow_mode(
self,
Expand Down

0 comments on commit 1c9abb3

Please sign in to comment.