diff --git a/pyproject.toml b/pyproject.toml index 9aff8aa8..ec55cacb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -174,6 +174,7 @@ cmd = """ [tool.pytest.ini_options] markers = [ "docker: marks tests as requiring docker (deselect with '-m \"not docker\"')", + "disable_fakefs: disable the fake filesystem in a hypothesis test" ] [tool.coverage.run] diff --git a/snakebids/tests/helpers.py b/snakebids/tests/helpers.py index d05872b6..b31a399a 100644 --- a/snakebids/tests/helpers.py +++ b/snakebids/tests/helpers.py @@ -25,9 +25,10 @@ from hypothesis import HealthCheck, example, settings from typing_extensions import ParamSpec -from snakebids import bids +from snakebids import bids_factory from snakebids.core.datasets import BidsDataset from snakebids.core.input_generation import generate_inputs +from snakebids.paths import specs from snakebids.types import InputsConfig, ZipList, ZipListLike from snakebids.utils.containers import MultiSelectDict, UserDictPy38 from snakebids.utils.utils import BidsEntity @@ -103,6 +104,7 @@ def get_bids_path(entities: Iterable[str | BidsEntity], **extras: str) -> str: def get_tag(entity: BidsEntity) -> tuple[str, str]: return entity.wildcard, f"{{{entity.wildcard}}}" + bids = bids_factory(specs.latest()) return bids( **dict(get_tag(BidsEntity(entity)) for entity in sorted(entities)), **{BidsEntity(entity).wildcard: value for entity, value in extras.items()}, diff --git a/snakebids/tests/test_generate_inputs.py b/snakebids/tests/test_generate_inputs.py index cb28cff7..5f556b3d 100644 --- a/snakebids/tests/test_generate_inputs.py +++ b/snakebids/tests/test_generate_inputs.py @@ -130,15 +130,23 @@ def test_second_return_never_none( pybidsdb_reset: bool | None, pybids_database_reset: bool | None, ): - assert ( - _normalize_database_args( - None, - pybidsdb_reset, - None, - pybids_database_reset, - )[1] - is not None - ) + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + message=r"The parameter `pybids_reset_database` in generate_inputs\(\) " + "is deprecated and will be removed in the next release. To reset the " + "pybids database, use the `pybidsdb_reset` parameter instead", + category=UserWarning, + ) + assert ( + _normalize_database_args( + None, + pybidsdb_reset, + None, + pybids_database_reset, + )[1] + is not None + ) @given(pybidsdb_dir=st.text().filter(_not_deprecated)) def test_deprecated_dir_raises_warning(self, pybidsdb_dir: str):