diff --git a/nitransforms/base.py b/nitransforms/base.py index 67acc073..fa05f1f6 100644 --- a/nitransforms/base.py +++ b/nitransforms/base.py @@ -287,6 +287,12 @@ def __len__(self): By default, all transforms are of length one. This must be overriden by transforms arrays and chains. + Example + ------- + >>> T1 = TransformBase() + >>> len(T1) + 1 + """ return 1 diff --git a/nitransforms/tests/test_base.py b/nitransforms/tests/test_base.py index 4bb147fd..49d7f7af 100644 --- a/nitransforms/tests/test_base.py +++ b/nitransforms/tests/test_base.py @@ -198,3 +198,18 @@ def test_SurfaceMesh(testdata_path): with pytest.raises(TypeError): SurfaceMesh(nb.load(shape_path)) + + +def test_apply_deprecation(monkeypatch): + """Make sure a deprecation warning is issued.""" + from nitransforms import resampling + + def _retval(*args, **kwargs): + return 1 + + monkeypatch.setattr(resampling, "apply", _retval) + + with pytest.deprecated_call(): + retval = TransformBase().apply() + + assert retval == 1