@@ -2346,35 +2346,35 @@ def assert_produces_warning(expected_warning=Warning, filter_level="always",
2346
2346
2347
2347
Parameters
2348
2348
----------
2349
- expected_warning : class Warning| False| None, default Warning
2349
+ expected_warning : { Warning, False, None} , default Warning
2350
2350
The type of Exception raised. ``exception.Warning`` is the base
2351
2351
class for all warnings. To check that no warning is returned,
2352
2352
specify ``False`` or ``None``.
2353
2353
filter_level : str, default "always"
2354
2354
Specifies whether warnings are ignored, displayed, or turned
2355
2355
into errors.
2356
2356
Valid values are:
2357
- "error" - turns matching warnings into exeptions
2358
- "ignore" - discard the warning
2359
- "always" - always emit a warning
2360
- "default" - print the warning the first time it is generated
2361
- from each location
2362
- "module" - print the warning the first time it is generated
2363
- from each module
2364
- "once" - print the warning the first time it is generated
2357
+ * "error" - turns matching warnings into exeptions
2358
+ * "ignore" - discard the warning
2359
+ * "always" - always emit a warning
2360
+ * "default" - print the warning the first time it is generated
2361
+ from each location
2362
+ * "module" - print the warning the first time it is generated
2363
+ from each module
2364
+ * "once" - print the warning the first time it is generated
2365
2365
clear : str, default None
2366
2366
If not ``None`` then remove any previously raised warnings from
2367
2367
the ``__warningsregistry__`` to ensure that no warning messages are
2368
2368
suppressed by this context manager. If ``None`` is specified,
2369
2369
the ``__warningsregistry__`` keeps track of which warnings have been
2370
2370
shown, and does not show them again.
2371
- check_stacklevel : bool, default true
2371
+ check_stacklevel : bool, default True
2372
2372
If True, displays the line that called the function containing
2373
2373
the warning to show were the function is called. Otherwise, the
2374
2374
line that implements the function is displayed.
2375
2375
2376
2376
Examples
2377
- ----------
2377
+ --------
2378
2378
>>> import warnings
2379
2379
>>> with assert_produces_warning():
2380
2380
... warnings.warn(UserWarning())
0 commit comments