We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0941b8f commit 17aef38Copy full SHA for 17aef38
2 files changed
tests/assets/encodingpackage/shift_jis_importer.py
@@ -0,0 +1,3 @@
1
+# -*- coding: shift_jis -*-
2
+
3
+from .imported import ƒÎ
tests/functional/test_encoding_handling.py
@@ -19,3 +19,23 @@ def test_build_graph_of_non_ascii_source():
19
"line_contents": "from .imported import π",
20
},
21
] == result
22
23
24
+def test_build_graph_of_non_utf8_source():
25
+ """
26
+ Tests we can cope with non UTF-8 Python source files.
27
28
+ graph = grimp.build_graph("encodingpackage", cache_dir=None)
29
30
+ result = graph.get_import_details(
31
+ importer="encodingpackage.shift_jis_importer", imported="encodingpackage.imported"
32
+ )
33
34
+ assert [
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