Yield a path to a fresh temp SQLite file, cleaned up on exit.
()
| 74 | |
| 75 | @contextlib.contextmanager |
| 76 | def _temp_db(): |
| 77 | """Yield a path to a fresh temp SQLite file, cleaned up on exit.""" |
| 78 | fd, path = tempfile.mkstemp(suffix=".db") |
| 79 | os.close(fd) |
| 80 | try: |
| 81 | yield path |
| 82 | finally: |
| 83 | os.unlink(path) |
| 84 | |
| 85 | |
| 86 | def _make_manpage_from_source(source: str) -> ParsedManpage: |
no test coverage detected