(self)
| 151 | 'stderr: utf-8/backslashreplace']) |
| 152 | |
| 153 | def test_io(self): |
| 154 | code = textwrap.dedent(''' |
| 155 | import sys |
| 156 | filename = sys.argv[1] |
| 157 | with open(filename) as fp: |
| 158 | print(f"{fp.encoding}/{fp.errors}") |
| 159 | ''') |
| 160 | filename = __file__ |
| 161 | |
| 162 | out = self.get_output('-c', code, filename, PYTHONUTF8='1') |
| 163 | self.assertEqual(out.lower(), 'utf-8/strict') |
| 164 | |
| 165 | def _check_io_encoding(self, module, encoding=None, errors=None): |
| 166 | filename = __file__ |
nothing calls this directly
no test coverage detected