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