@@ -75,7 +75,7 @@ E.g., renaming an attribute ``labels_`` to ``classes_`` can be done as::
7575 def labels_(self):
7676 return self.classes_
7777
78- If a parameter has to be deprecated, use ``DeprecationWarning `` appropriately.
78+ If a parameter has to be deprecated, use ``FutureWarning `` appropriately.
7979In the following example, k is deprecated and renamed to n_clusters::
8080
8181 import warnings
@@ -106,49 +106,6 @@ On the top of all the functionality provided by scikit-learn. imbalanced-learn
106106provides :func: `deprecate_parameter `: which is used to deprecate a sampler's
107107parameter (attribute) by another one.
108108
109- Testing utilities
110- ~~~~~~~~~~~~~~~~~
111- Currently, imbalanced-learn provide a warning management utility. This feature
112- is going to be merge in pytest and will be removed when the pytest release will
113- have it.
114-
115- If using Python 2.7 or above, you may use this function as a
116- context manager::
117-
118- >>> import warnings
119- >>> from imblearn.utils.testing import warns
120- >>> with warns(RuntimeWarning):
121- ... warnings.warn("my runtime warning", RuntimeWarning)
122-
123- >>> with warns(RuntimeWarning):
124- ... pass
125- Traceback (most recent call last):
126- ...
127- Failed: DID NOT WARN. No warnings of type ...RuntimeWarning... was emitted...
128-
129- >>> with warns(RuntimeWarning):
130- ... warnings.warn(UserWarning)
131- Traceback (most recent call last):
132- ...
133- Failed: DID NOT WARN. No warnings of type ...RuntimeWarning... was emitted...
134-
135- In the context manager form you may use the keyword argument ``match `` to assert
136- that the exception matches a text or regex::
137-
138- >>> import warnings
139- >>> from imblearn.utils.testing import warns
140- >>> with warns(UserWarning, match='must be 0 or None'):
141- ... warnings.warn("value must be 0 or None", UserWarning)
142-
143- >>> with warns(UserWarning, match=r'must be \d+$'):
144- ... warnings.warn("value must be 42", UserWarning)
145-
146- >>> with warns(UserWarning, match=r'must be \d+$'):
147- ... warnings.warn("this is not here", UserWarning)
148- Traceback (most recent call last):
149- ...
150- AssertionError: 'must be \d+$' pattern not found in ['this is not here']
151-
152109Making a release
153110----------------
154111This section document the different steps that are necessary to make a new
0 commit comments