Asserting result of `tabnanny.errprint()` by giving sample inputs.
(self)
| 101 | """Testing `tabnanny.errprint()`.""" |
| 102 | |
| 103 | def test_errprint(self): |
| 104 | """Asserting result of `tabnanny.errprint()` by giving sample inputs.""" |
| 105 | tests = [ |
| 106 | (['first', 'second'], 'first second\n'), |
| 107 | (['first'], 'first\n'), |
| 108 | ([1, 2, 3], '1 2 3\n'), |
| 109 | ([], '\n') |
| 110 | ] |
| 111 | |
| 112 | for args, expected in tests: |
| 113 | with self.subTest(arguments=args, expected=expected): |
| 114 | with self.assertRaises(SystemExit): |
| 115 | with captured_stderr() as stderr: |
| 116 | tabnanny.errprint(*args) |
| 117 | self.assertEqual(stderr.getvalue() , expected) |
| 118 | |
| 119 | |
| 120 | class TestNannyNag(TestCase): |
nothing calls this directly
no test coverage detected