Skip to content

Commit

Permalink
normalize unicode in test output
Browse files Browse the repository at this point in the history
for consistency on Windows, posix
  • Loading branch information
minrk committed Apr 14, 2023
1 parent 1b7d25c commit 82a631c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nbclient/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import re
import threading
import unicodedata
import warnings
from base64 import b64decode, b64encode
from queue import Empty
Expand Down Expand Up @@ -723,11 +724,11 @@ def test_force_raise_errors(self):
run_notebook(filename, {"force_raise_errors": True}, res)

# verify CellExecutionError contents
exc_str = str(exc.value)
exc_str = unicodedata.normalize("NFC", str(exc.value))
# print for better debugging with captured output
# print(exc_str)
assert "Exception: message" in exc_str
assert "# üñîçø∂é" in exc_str
assert unicodedata.normalize("NFC", "# üñîçø∂é") in exc_str
assert "stderr" in exc_str
assert "stdout" in exc_str
assert "hello\n" in exc_str
Expand Down

0 comments on commit 82a631c

Please sign in to comment.