diff --git a/dask/diagnostics/profile.py b/dask/diagnostics/profile.py index f718efd56f2..c7802b77ab3 100644 --- a/dask/diagnostics/profile.py +++ b/dask/diagnostics/profile.py @@ -51,6 +51,7 @@ class Profiler(Callback): manually. >>> prof.clear() + >>> prof.unregister() """ @@ -140,6 +141,8 @@ class ResourceProfiler(Callback): Note that when used as a context manager data will be collected throughout the duration of the enclosed block. In contrast, when registered globally data will only be collected while a dask scheduler is active. + + >>> prof.unregister() """ def __init__(self, dt=1): @@ -322,6 +325,7 @@ class CacheProfiler(Callback): manually. >>> prof.clear() + >>> prof.unregister() """ diff --git a/dask/diagnostics/tests/test_progress.py b/dask/diagnostics/tests/test_progress.py index bb2c050c8bd..8967a96a0c4 100644 --- a/dask/diagnostics/tests/test_progress.py +++ b/dask/diagnostics/tests/test_progress.py @@ -68,6 +68,7 @@ def test_format_time(): def test_register(capsys): try: + assert not Callback.active p = ProgressBar() p.register()