(self, content, encoding="utf-8")
| 275 | |
| 276 | @contextlib.contextmanager |
| 277 | def script(self, content, encoding="utf-8"): |
| 278 | file = Path(tempfile.mktemp(dir=os.getcwd()) + ".py") |
| 279 | if isinstance(content, bytes): |
| 280 | file.write_bytes(content) |
| 281 | else: |
| 282 | file.write_text(content, encoding=encoding) |
| 283 | try: |
| 284 | yield file |
| 285 | finally: |
| 286 | file.unlink() |
| 287 | |
| 288 | @contextlib.contextmanager |
| 289 | def fake_venv(self): |
no test coverage detected