MCPcopy Create free account
hub / github.com/EasyIME/PIME / setUp

Method setUp

python/python3/tornado/test/log_test.py:46–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 )
45
46 def setUp(self):
47 self.formatter = LogFormatter(color=False)
48 # Fake color support. We can't guarantee anything about the $TERM
49 # variable when the tests are run, so just patch in some values
50 # for testing. (testing with color off fails to expose some potential
51 # encoding issues from the control characters)
52 self.formatter._colors = {logging.ERROR: u"\u0001"}
53 self.formatter._normal = u"\u0002"
54 # construct a Logger directly to bypass getLogger's caching
55 self.logger = logging.Logger("LogFormatterTest")
56 self.logger.propagate = False
57 self.tempdir = tempfile.mkdtemp()
58 self.filename = os.path.join(self.tempdir, "log.out")
59 self.handler = self.make_handler(self.filename)
60 self.handler.setFormatter(self.formatter)
61 self.logger.addHandler(self.handler)
62
63 def tearDown(self):
64 self.handler.close()

Callers 1

setUpMethod · 0.45

Calls 3

make_handlerMethod · 0.95
LogFormatterClass · 0.90
joinMethod · 0.80

Tested by

no test coverage detected