@@ -114,25 +114,27 @@ def _skip_if_no_scipy() -> bool:
114
114
)
115
115
116
116
117
- # TODO(pytest#7469): return type, _pytest.mark.structures.MarkDecorator is not public
118
- # https://github.com/pytest-dev/pytest/issues/7469
119
- def skip_if_installed (package : str ):
117
+ def skip_if_installed (package : str ) -> pytest .MarkDecorator :
120
118
"""
121
119
Skip a test if a package is installed.
122
120
123
121
Parameters
124
122
----------
125
123
package : str
126
124
The name of the package.
125
+
126
+ Returns
127
+ -------
128
+ pytest.MarkDecorator
129
+ a pytest.mark.skipif to use as either a test decorator or a
130
+ parametrization mark.
127
131
"""
128
132
return pytest .mark .skipif (
129
133
safe_import (package ), reason = f"Skipping because { package } is installed."
130
134
)
131
135
132
136
133
- # TODO(pytest#7469): return type, _pytest.mark.structures.MarkDecorator is not public
134
- # https://github.com/pytest-dev/pytest/issues/7469
135
- def skip_if_no (package : str , min_version : str | None = None ):
137
+ def skip_if_no (package : str , min_version : str | None = None ) -> pytest .MarkDecorator :
136
138
"""
137
139
Generic function to help skip tests when required packages are not
138
140
present on the testing system.
@@ -158,7 +160,7 @@ def skip_if_no(package: str, min_version: str | None = None):
158
160
159
161
Returns
160
162
-------
161
- _pytest.mark.structures .MarkDecorator
163
+ pytest .MarkDecorator
162
164
a pytest.mark.skipif to use as either a test decorator or a
163
165
parametrization mark.
164
166
"""
@@ -189,9 +191,9 @@ def skip_if_no(package: str, min_version: str | None = None):
189
191
)
190
192
191
193
192
- # TODO(pytest#7469): return type, _pytest.mark.structures.MarkDecorator is not public
193
- # https://github.com/pytest-dev/pytest/issues/7469
194
- def skip_if_np_lt ( ver_str : str , * args , reason : str | None = None ) :
194
+ def skip_if_np_lt (
195
+ ver_str : str , * args , reason : str | None = None
196
+ ) -> pytest . MarkDecorator :
195
197
if reason is None :
196
198
reason = f"NumPy { ver_str } or greater required"
197
199
return pytest .mark .skipif (
0 commit comments