Check if module `f` is deprecated Parameters ---------- f : ModuleType Returns ------- bool
(f)
| 289 | |
| 290 | |
| 291 | def is_deprecated(f): |
| 292 | """ |
| 293 | Check if module `f` is deprecated |
| 294 | |
| 295 | Parameters |
| 296 | ---------- |
| 297 | f : ModuleType |
| 298 | |
| 299 | Returns |
| 300 | ------- |
| 301 | bool |
| 302 | """ |
| 303 | with warnings.catch_warnings(record=True) as w: |
| 304 | warnings.simplefilter("error") |
| 305 | try: |
| 306 | f(**{"not a kwarg": None}) |
| 307 | except DeprecationWarning: |
| 308 | return True |
| 309 | except Exception: |
| 310 | pass |
| 311 | return False |
| 312 | |
| 313 | |
| 314 | def check_items(all_dict, names, deprecated, others, module_name, dots=True): |
no test coverage detected
searching dependent graphs…