We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41dd6e4 commit ed14ed7Copy full SHA for ed14ed7
test/snapshottest.py
@@ -37,9 +37,9 @@ def _safe_cls_name(o: type):
37
38
def _open_or_create_rw(path: str):
39
try:
40
- return open(path, 'r+')
+ return open(path, 'r+', encoding='utf8')
41
except FileNotFoundError:
42
- return open(path, 'w+') # Try to create if not exists
+ return open(path, 'w+', encoding='utf8') # Try to create if not exists
43
44
45
_SNAPS_NOT_FOUND_MSG = (
@@ -122,7 +122,7 @@ def setUp(self) -> None:
122
@classmethod
123
def _read_snapshot_text(cls):
124
125
- with open(cls.snap_file) as f:
+ with open(cls.snap_file, encoding='utf8') as f:
126
return f.read()
127
except FileNotFoundError as orig_err:
128
raise SnapshotsNotFound("Snapshot file not found") from orig_err
0 commit comments