A python source code with whitespace related sampled problems.
(self)
| 273 | self.assertFalse(MockNannyNag.called) |
| 274 | |
| 275 | def test_with_errored_codes_samples(self): |
| 276 | """A python source code with whitespace related sampled problems.""" |
| 277 | |
| 278 | # "tab_space_errored_1": executes block under type == tokenize.INDENT |
| 279 | # at `tabnanny.process_tokens()`. |
| 280 | # "tab space_errored_2": executes block under |
| 281 | # `check_equal and type not in JUNK` condition at |
| 282 | # `tabnanny.process_tokens()`. |
| 283 | |
| 284 | for key in ["tab_space_errored_1", "tab_space_errored_2"]: |
| 285 | with self.subTest(key=key): |
| 286 | with TemporaryPyFile(SOURCE_CODES[key]) as file_path: |
| 287 | with open(file_path) as f: |
| 288 | tokens = tokenize.generate_tokens(f.readline) |
| 289 | with self.assertRaises(tabnanny.NannyNag): |
| 290 | tabnanny.process_tokens(tokens) |
| 291 | |
| 292 | |
| 293 | class TestCommandLine(TestCase): |
nothing calls this directly
no test coverage detected