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 7c427d1 commit 2f8f58dCopy full SHA for 2f8f58d
src/common/test_tools/types.py
@@ -21,14 +21,14 @@ def __call__(self, name: str = "") -> "Snapshot": ...
21
class Snapshot:
22
def __init__(self, path: Path, for_update: bool) -> None:
23
self.path = path
24
- self.content = open(path).read()
+ self.content = open(path, encoding="utf-8").read()
25
self.for_update = for_update
26
27
def __eq__(self, other: object) -> bool:
28
if self.content == other:
29
return True
30
if self.for_update and isinstance(other, str):
31
- with open(self.path, "w") as f:
+ with open(self.path, "w", encoding="utf-8") as f:
32
f.write(other)
33
pytest.xfail(reason=f"Snapshot updated: {self.path}")
34
return False
0 commit comments