Asserting behaviour of `tabnanny.NannyNag` exception.
(self)
| 119 | |
| 120 | class TestNannyNag(TestCase): |
| 121 | def test_all_methods(self): |
| 122 | """Asserting behaviour of `tabnanny.NannyNag` exception.""" |
| 123 | tests = [ |
| 124 | ( |
| 125 | tabnanny.NannyNag(0, "foo", "bar"), |
| 126 | {'lineno': 0, 'msg': 'foo', 'line': 'bar'} |
| 127 | ), |
| 128 | ( |
| 129 | tabnanny.NannyNag(5, "testmsg", "testline"), |
| 130 | {'lineno': 5, 'msg': 'testmsg', 'line': 'testline'} |
| 131 | ) |
| 132 | ] |
| 133 | for nanny, expected in tests: |
| 134 | line_number = nanny.get_lineno() |
| 135 | msg = nanny.get_msg() |
| 136 | line = nanny.get_line() |
| 137 | with self.subTest( |
| 138 | line_number=line_number, expected=expected['lineno'] |
| 139 | ): |
| 140 | self.assertEqual(expected['lineno'], line_number) |
| 141 | with self.subTest(msg=msg, expected=expected['msg']): |
| 142 | self.assertEqual(expected['msg'], msg) |
| 143 | with self.subTest(line=line, expected=expected['line']): |
| 144 | self.assertEqual(expected['line'], line) |
| 145 | |
| 146 | |
| 147 | class TestCheck(TestCase): |
nothing calls this directly
no test coverage detected