def test_restore(self):
""" should restore from an enabled state """
support.create_project(self, 'percy')
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.restore_default_configuration()
self.assertNotIsInstance(sys.stdout, redirection.RedirectBuffer)
self.assertNotIsInstance(sys.stderr, redirection.RedirectBuffer)
self.assertEqual(sys.stdout, sys.__stdout__)
self.assertEqual(sys.stderr, sys.__stderr__)
评论列表
文章目录