def test_enable_disable(self):
""" should properly enable and disable redirection """
support.create_project(self, 'tonks')
support.add_step(self)
project = cd.project.internal_project
step = project.steps[0]
redirection.enable(step)
self.assertIsInstance(sys.stdout, redirection.RedirectBuffer)
self.assertIsInstance(sys.stderr, redirection.RedirectBuffer)
redirection.disable(step)
self.assertNotIsInstance(sys.stdout, redirection.RedirectBuffer)
self.assertNotIsInstance(sys.stderr, redirection.RedirectBuffer)
self.assertEqual(sys.stdout, sys.__stdout__)
self.assertEqual(sys.stderr, sys.__stderr__)
评论列表
文章目录