File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
import time
3
+ import warnings
3
4
4
5
import aiohttp
5
6
import dask
@@ -409,19 +410,17 @@ def test():
409
410
410
411
def test_cleanup ():
411
412
# No warnings raised by cleanup function
412
- with pytest .warns (UserWarning ) as rec :
413
+ with warnings .catch_warnings ():
414
+ warnings .simplefilter ("error" , UserWarning )
413
415
cleanup_lingering_clusters ()
414
- for r in rec :
415
- assert not issubclass (r .category , UserWarning )
416
416
417
417
# Cluster is now closed
418
418
assert cluster .status == "closed"
419
419
420
420
# No harm in double running
421
- with pytest .warns (UserWarning ) as rec :
421
+ with warnings .catch_warnings ():
422
+ warnings .simplefilter ("error" , UserWarning )
422
423
cleanup_lingering_clusters ()
423
- for r in rec :
424
- assert not issubclass (r .category , UserWarning )
425
424
426
425
await loop .run_in_executor (None , test_cleanup )
427
426
You can’t perform that action at this time.
0 commit comments