def test_discard_stderr(self): """This method is not programatically testable, But will produce no expected output If it fails it becomes noticable at command line """ # pylint: disable=no-self-use with swallow_stderr(): print >> sys.stderr, 'hello'
def test_swallow_stderr(self): stream = StringIO() with swallow_stderr(stream): print >> sys.stderr, 'hello' self.assertEqual(stream.getvalue(), 'hello\n')
def test_no_args(self): with streams.swallow_stderr(): self.assertRaises(SystemExit, re_render.parse_args, [])