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 fe82830 commit 9513520Copy full SHA for 9513520
src/common/test_tools/types.py
@@ -21,7 +21,8 @@ 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, encoding="utf-8").read()
+ mode = "r" if not for_update else "w+"
25
+ self.content = open(path, encoding="utf-8", mode=mode).read()
26
self.for_update = for_update
27
28
def __eq__(self, other: object) -> bool:
0 commit comments