(hmmax3)
| 260 | |
| 261 | |
| 262 | def test_hist_file_config(hmmax3): |
| 263 | cfg = Config() |
| 264 | tfile = tempfile.NamedTemporaryFile(delete=False) |
| 265 | cfg.HistoryManager.hist_file = Path(tfile.name) |
| 266 | hm = None |
| 267 | try: |
| 268 | hm = HistoryManager(shell=get_ipython(), config=cfg) |
| 269 | assert hm.hist_file == cfg.HistoryManager.hist_file |
| 270 | finally: |
| 271 | if hm is not None: |
| 272 | # Stop the saving thread and close the database, otherwise the |
| 273 | # thread can briefly hold a strong reference to the manager, |
| 274 | # making the instance-leak check in the fixture teardown flaky |
| 275 | # (gh-15161). |
| 276 | hm.save_thread.stop() |
| 277 | hm.db.close() |
| 278 | try: |
| 279 | Path(tfile.name).unlink() |
| 280 | except OSError: |
| 281 | # same catch as in testing.tools.TempFileMixin |
| 282 | # On Windows, even though we close the file, we still can't |
| 283 | # delete it. I have no clue why |
| 284 | pass |
| 285 | |
| 286 | |
| 287 | def test_histmanager_memory_fallback_reopens_db(hmmax3, tmp_path, caplog): |
nothing calls this directly
no test coverage detected
searching dependent graphs…