Skip to content

Commit 25a4a26

Browse files
committed
added missing imports to autogenerated conftest
1 parent 2cedffa commit 25a4a26

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

nipype2pydra/task/base.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class InputsConverter(SpecConverter):
157157
metadata: dict[str, dict[str, Any]], optional
158158
additional metadata to set on any of the input fields (e.g. out_file: position: 1)
159159
"""
160+
160161
callable_defaults: ty.Dict[str, str] = attrs.field(
161162
factory=dict,
162163
converter=default_if_none(factory=dict), # type: ignore
@@ -403,7 +404,8 @@ class BaseTaskConverter(metaclass=ABCMeta):
403404
converter=from_dict_to_outputs,
404405
)
405406
callables_module: ModuleType = attrs.field(
406-
converter=import_module_from_path, default=None,
407+
converter=import_module_from_path,
408+
default=None,
407409
)
408410
tests: ty.List[TestGenerator] = attrs.field( # type: ignore
409411
factory=list, converter=from_list_to_tests
@@ -838,7 +840,9 @@ def write_tests(self, filename_test, input_fields, nonstd_types, run=False):
838840
else:
839841
assert len(field) == 3
840842
# Attempt to pick a sensible value for field
841-
trait = self.nipype_interface.input_spec.class_traits()[nm]
843+
trait = self.nipype_interface.input_spec.class_traits()[
844+
nm
845+
]
842846
if isinstance(trait, traits.trait_types.Enum):
843847
value = trait.values[0]
844848
elif isinstance(trait, traits.trait_types.Range):
@@ -868,7 +872,10 @@ def write_tests(self, filename_test, input_fields, nonstd_types, run=False):
868872
imports = self.construct_imports(
869873
nonstd_types,
870874
spec_str,
871-
base={"import pytest", "from nipype2pydra.testing import PassAfterTimeoutWorker"},
875+
base={
876+
"import pytest",
877+
"from nipype2pydra.testing import PassAfterTimeoutWorker",
878+
},
872879
)
873880
spec_str = "\n".join(imports) + "\n\n" + spec_str
874881

@@ -946,6 +953,10 @@ def create_doctests(self, input_fields, nonstd_types):
946953
CONFTEST = """
947954
# For debugging in IDE's don't catch raised exceptions and let the IDE
948955
# break at it
956+
import os
957+
import pytest
958+
959+
949960
if os.getenv("_PYTEST_RAISE", "0") != "0":
950961
951962
@pytest.hookimpl(tryfirst=True)

required-fileformats/afni/fileformats/medimage_afni/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from fileformats.generic import File
22

33

4-
class Oned(File):
4+
class OneD(File):
55
ext = ".1D"
66
alternate_exts = (".1d",)
77
binary = True
88

99

10-
class Threed(File):
10+
class ThreeD(File):
1111
ext = ".3D"
1212
binary = True
1313

0 commit comments

Comments
 (0)