Skip to content
This repository
Newer
Older
100644 21 lines (14 sloc) 0.508 kb
2a379812 »
2010-09-23 Docstrings for benchmarks
1 """Like the filter test, but with the should_handle implemented"""
ba8171ad »
2010-09-23 Added some logging benchmarks too
2 from logbook import Logger, StreamHandler, NullHandler
3 from cStringIO import StringIO
4
5
6 log = Logger('Test logger')
7
8
9 class CustomStreamHandler(StreamHandler):
10 def should_handle(self, record):
11 return False
12
13
14 def run():
15 out = StringIO()
16 with NullHandler():
17 with CustomStreamHandler(out) as handler:
18 for x in xrange(500):
19 log.warning('this is not handled')
20 assert not out.getvalue()
Something went wrong with that request. Please try again.