Skip to content

Commit

Permalink
unregister cache in doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Aug 3, 2015
1 parent 5f507bc commit dcfebeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions dask/diagnostics/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Cache(Diagnostic):
... result = x.compute() # doctest: +SKIP
>>> cache.register() # or use globally
>>> cache.unregister()
"""

def __init__(self, cache, *args, **kwargs):
Expand Down
3 changes: 3 additions & 0 deletions dask/diagnostics/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import cachey
from dask.threaded import get
from operator import add
from dask.context import _globals


flag = []
Expand All @@ -28,6 +29,8 @@ def test_cache():

assert flag == [2] # no x present

assert not _globals['callbacks']


def test_cache_with_number():
c = Cache(10000, limit=1)
Expand Down

0 comments on commit dcfebeb

Please sign in to comment.