Ensure that although whitespace might be mutated in a roundtrip, the semantic meaning of the indentation remains consistent.
(self)
| 2197 | return tokenize.untokenize(tokenize.tokenize(BytesIO(code).readline)).decode('utf-8') |
| 2198 | |
| 2199 | def test_indentation_semantics_retained(self): |
| 2200 | """ |
| 2201 | Ensure that although whitespace might be mutated in a roundtrip, |
| 2202 | the semantic meaning of the indentation remains consistent. |
| 2203 | """ |
| 2204 | code = "if False:\n\tx=3\n\tx=3\n" |
| 2205 | codelines = self.roundtrip(code).split('\n') |
| 2206 | self.assertEqual(codelines[1], codelines[2]) |
| 2207 | self.check_roundtrip(code) |
| 2208 | |
| 2209 | |
| 2210 | class InvalidPythonTests(TestCase): |
nothing calls this directly
no test coverage detected