Skip to content

Commit

Permalink
Restrict root dir from test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Jan 22, 2024
1 parent 0bce37b commit 8801fcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snakebids/tests/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def test_writes_correct_format(self, ext: str, path: Path, mocker: MockerFixture
mocks["yamldump"].assert_called_once_with({}, path)

@allow_function_scoped
@given(path=st.text().filter(lambda s: s not in {".", ""}))
@given(path=st.text().filter(lambda s: s not in {".", "", "/"}))
def test_doesnt_overwrite_file(self, path: str, fakefs: FakeFilesystem):
fakefs.reset()
fakefs.create_file(path)
with pytest.raises(FileExistsError, match="already exists"):
configio.write_config(path, {})

@allow_function_scoped
@given(path=st.text().filter(lambda s: s not in {".", ""}))
@given(path=st.text().filter(lambda s: s not in {".", "", "/"}))
def test_overwrites_file_if_forced(
self, path: str, fakefs: FakeFilesystem, mocker: MockerFixture
):
Expand Down

0 comments on commit 8801fcd

Please sign in to comment.