MCPcopy Create free account
hub / github.com/PythonOT/POT / test_deprecated_func

Function test_deprecated_func

test/test_utils.py:401–425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

399
400
401def 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
428def test_BaseEstimator():

Callers

nothing calls this directly

Calls 2

ClassClass · 0.85
funFunction · 0.70

Tested by

no test coverage detected