| 399 | |
| 400 | |
| 401 | def test_deprecated_func(): |
| 402 | @ot.utils.deprecated("deprecated text for fun") |
| 403 | def fun(): |
| 404 | pass |
| 405 | |
| 406 | def fun2(): |
| 407 | pass |
| 408 | |
| 409 | @ot.utils.deprecated("deprecated text for class") |
| 410 | class Class: |
| 411 | pass |
| 412 | |
| 413 | with pytest.warns(DeprecationWarning): |
| 414 | fun() |
| 415 | |
| 416 | with pytest.warns(DeprecationWarning): |
| 417 | cl = Class() |
| 418 | print(cl) |
| 419 | |
| 420 | if sys.version_info < (3, 5): |
| 421 | print("Not tested") |
| 422 | else: |
| 423 | assert ot.utils._is_deprecated(fun) is True |
| 424 | |
| 425 | assert ot.utils._is_deprecated(fun2) is False |
| 426 | |
| 427 | |
| 428 | def test_BaseEstimator(): |