Permalink
Newer
Older
100644 16 lines (13 sloc) 507 Bytes
1
"""Tests basic stack manipulation performance"""
2
from logbook import Handler, NullHandler, StreamHandler, FileHandler, \
3
ERROR, WARNING
4
from tempfile import NamedTemporaryFile
5
from cStringIO import StringIO
6
7
8
def run():
9
f = NamedTemporaryFile()
10
out = StringIO()
11
with NullHandler():
12
with StreamHandler(out, level=WARNING):
13
with FileHandler(f.name, level=ERROR):
14
for x in xrange(100):
15
list(Handler.stack_manager.iter_context_objects())