Skip to content

Commit b658fa2

Browse files
committed
Add test to verify support for non-utf8 Python files
While it's recommended to encode Python files in UTF8, we should support alternative encodings.
1 parent 474453e commit b658fa2

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# This file is encoded in shift_jis
2-
from .imported import ƒÎ
1+
# -*- coding: shift_jis -*-
2+
3+
from .imported import ƒÎ

tests/functional/test_encoding_handling.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def test_build_graph_of_non_utf8_source():
3232
)
3333

3434
assert [
35-
{
36-
"importer": "encodingpackage.shift_jis_importer",
37-
"imported": "encodingpackage.imported",
38-
"line_number": 2,
39-
"line_contents": "from .imported import π",
40-
},
41-
] == result
35+
{
36+
"importer": "encodingpackage.shift_jis_importer",
37+
"imported": "encodingpackage.imported",
38+
"line_number": 3,
39+
"line_contents": "from .imported import π",
40+
},
41+
] == result

0 commit comments

Comments
 (0)