Skip to content

Commit

Permalink
same treatment for functional test update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Sep 19, 2024
1 parent fd2883e commit 96592c9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
10 changes: 9 additions & 1 deletion pylint/testutils/functional/lint_module_output_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@ def _check_output_text(
with open(self._test_file.expected_output, "w", encoding="utf-8") as f:
writer = csv.writer(f, dialect="test")
for line in actual_output:
writer.writerow(line.to_csv())
try:
writer.writerow(line.to_csv())
except UnicodeEncodeError:
writer.writerow(
[
s.encode("utf8", "ignore").decode("utf8")
for s in line.to_csv()
]
)
10 changes: 9 additions & 1 deletion pylint/testutils/lint_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,15 @@ def error_msg_for_unequal_output(
expected_csv = StringIO()
writer = csv.writer(expected_csv, dialect="test")
for line in sorted(received_lines, key=sort_by_line_number):
writer.writerow(line.to_csv())
try:
writer.writerow(line.to_csv())
except UnicodeEncodeError:
writer.writerow(
[
s.encode("utf8", "ignore").decode("utf8")
for s in line.to_csv()
]
)
error_msg += expected_csv.getvalue()
return error_msg

Expand Down
5 changes: 3 additions & 2 deletions tests/functional/r/regression_02/regression_8736.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""This does not crash in the functional tests, but it does when called directly"""
assert "\U00010000" == "\ud800\udc00"
"""This does not crash in the functional tests, but it did when called directly."""

assert "\U00010000" == "\ud800\udc00" # [comparison-of-constants]
1 change: 1 addition & 0 deletions tests/functional/r/regression_02/regression_8736.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comparison-of-constants:3:7:3:37::"Comparison between constants: '𐀀 == ' has a constant value":HIGH

0 comments on commit 96592c9

Please sign in to comment.