Add failing test for py27 ast.parse(<unicode>)
@@ -51,6 +51,13 @@ def test_main_non_utf8_bytes(tmpdir, capsys):
assert out == '{} is non-utf-8 (not supported)\n'.format(f.strpath)
+def test_main_py27_syntaxerror_coding(tmpdir):
+ f = tmpdir.join('f.py')
+ f.write('# -*- coding: utf-8\nset((1, 2))\n')
+ assert main((f.strpath,)) == 1
+ assert f.read() == '# -*- coding: utf-8\n{1, 2}\n'
+
+
def test_keep_percent_format(tmpdir):
f = tmpdir.join('f.py')
f.write('"%s" % (1,)')
