Skip to content

Commit 4c06174

Browse files
committed
enh: expand test coverage
1 parent 9f91e2f commit 4c06174

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

nitransforms/base.py

+6
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ def __len__(self):
287287
By default, all transforms are of length one.
288288
This must be overriden by transforms arrays and chains.
289289
290+
Example
291+
-------
292+
>>> T1 = TransformBase()
293+
>>> len(T1)
294+
1
295+
290296
"""
291297
return 1
292298

nitransforms/tests/test_base.py

+15
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,18 @@ def test_SurfaceMesh(testdata_path):
198198

199199
with pytest.raises(TypeError):
200200
SurfaceMesh(nb.load(shape_path))
201+
202+
203+
def test_apply_deprecation(monkeypatch):
204+
"""Make sure a deprecation warning is issued."""
205+
from nitransforms import resampling
206+
207+
def _retval(*args, **kwargs):
208+
return 1
209+
210+
monkeypatch.setattr(resampling, "apply", _retval)
211+
212+
with pytest.deprecated_call():
213+
retval = TransformBase().apply()
214+
215+
assert retval == 1

0 commit comments

Comments
 (0)