(self)
| 148 | |
| 149 | def generate_test(infile, outfile, normalize, kwargs): |
| 150 | def test(self): |
| 151 | with open(infile, encoding="utf-8") as f: |
| 152 | input = f.read() |
| 153 | with open(outfile, encoding="utf-8") as f: |
| 154 | # Normalize line endings |
| 155 | # (on Windows, git may have altered line endings). |
| 156 | expected = f.read().replace("\r\n", "\n") |
| 157 | output = markdown(input, **kwargs) |
| 158 | if tidylib and normalize: |
| 159 | try: |
| 160 | expected = _normalize_whitespace(expected) |
| 161 | output = _normalize_whitespace(output) |
| 162 | except OSError: |
| 163 | self.skipTest("Tidylib's c library not available.") |
| 164 | elif normalize: |
| 165 | self.skipTest('Tidylib not available.') |
| 166 | self.assertMultiLineEqual(output, expected) |
| 167 | return test |
| 168 | |
| 169 | location = dct.get('location', '') |
no test coverage detected