def package():
# Apply gevent monkey patches as early as possible during tests.
from gevent.monkey import patch_all
patch_all()
# Enable all warnings in test mode.
warnings.resetwarnings()
warnings.simplefilter('default')
# Look for memory leaks.
gc.set_debug(gc.DEBUG_UNCOLLECTABLE)
yield None
# Print memory leaks.
if gc.garbage: # pragma: no cover
print('Uncollectable objects found:')
for obj in gc.garbage:
print(obj)
评论列表
文章目录