コード例 #1
0
ファイル: testing.py プロジェクト: thijsvanwinden/nutils
 def setUp(self):
     super().setUp()
     self.enter_context(
         treelog.set(
             treelog.TeeLog(treelog.StdoutLog(), treelog.LoggingLog())))
     self.enter_context(_builtin_warnings.catch_warnings())
     _builtin_warnings.simplefilter('error', warnings.NutilsWarning)
コード例 #2
0
 def output_tester(self):
     with self.assertLogs('nutils') as cm:
         yield treelog.LoggingLog()
     self.assertEqual(cm.output, [
         'Level 25:nutils:my message', 'INFO:nutils:test.dat',
         'INFO:nutils:my context > iter 1 > a',
         'INFO:nutils:my context > iter 2 > b',
         'INFO:nutils:my context > iter 3 > c',
         'ERROR:nutils:my context > multiple..\n  ..lines',
         'INFO:nutils:my context > generating',
         'Level 25:nutils:my context > test.dat',
         'WARNING:nutils:generate_test > test.dat',
         'INFO:nutils:context step=0 > foo',
         'INFO:nutils:context step=1 > bar', 'ERROR:nutils:same.dat',
         'WARNING:nutils:warn'
     ])
コード例 #3
0
ファイル: testing.py プロジェクト: scdivi/nutils
 def setUpContext(self, stack):
     stack.enter_context(treelog.set(treelog.LoggingLog()))
コード例 #4
0
 def setUp(self):
     super().setUp()
     self.enter_context(
         treelog.set(
             treelog.TeeLog(treelog.StdoutLog(), treelog.LoggingLog())))
コード例 #5
0
 def setUpContext(self, stack):
     stack.enter_context(
         treelog.set(
             treelog.TeeLog(treelog.StdoutLog(), treelog.LoggingLog())))
コード例 #6
0
 def test_replay_in_current(self):
     recordlog = treelog.RecordLog()
     recordlog.write('test', level=treelog.proto.Level.info)
     with self.assertSilent(), treelog.set(
             treelog.LoggingLog()), self.assertLogs('nutils'):
         recordlog.replay()