(path, valid=True)
| 20 | |
| 21 | |
| 22 | def write_source(path, valid=True): |
| 23 | # type: (str, bool) -> None |
| 24 | with safe_open(path, "wb") as fp: |
| 25 | fp.write(to_bytes("basename = %r\n" % os.path.basename(path))) |
| 26 | if not valid: |
| 27 | fp.write(to_bytes("invalid!\n")) |
| 28 | |
| 29 | |
| 30 | @contextlib.contextmanager |
no test coverage detected