We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 943e5e8 commit 7e96a94Copy full SHA for 7e96a94
nibabel/testing/__init__.py
@@ -16,6 +16,7 @@
16
17
import unittest
18
19
+import pytest
20
import numpy as np
21
from numpy.testing import assert_array_equal
22
@@ -223,3 +224,15 @@ def setUp(self):
223
224
if self.__class__.__name__.startswith('_'):
225
raise unittest.SkipTest("Base test case - subclass to run")
226
super().setUp()
227
+
228
229
+def expires(version):
230
+ "Decorator to mark a test as xfail with ExpiredDeprecationError after version"
231
+ from packaging.version import Version
232
+ from nibabel import __version__ as nbver
233
+ from nibabel.deprecator import ExpiredDeprecationError
234
235
+ if Version(nbver) < Version(version):
236
+ return lambda x: x
237
238
+ return pytest.mark.xfail(raises=ExpiredDeprecationError)
0 commit comments