()
| 83 | f'{wt=}' |
| 84 | |
| 85 | def test_2355(): |
| 86 | |
| 87 | # Create a test PDF with toc. |
| 88 | doc = pymupdf.Document() |
| 89 | for _ in range(10): |
| 90 | doc.new_page(doc.page_count) |
| 91 | doc.set_toc([[1, 'test', 1], [1, 'test2', 5]]) |
| 92 | |
| 93 | path = 'test_2355.pdf' |
| 94 | doc.save(path) |
| 95 | |
| 96 | # Open many times |
| 97 | for i in range(10): |
| 98 | with pymupdf.open(path) as new_doc: |
| 99 | new_doc.get_toc() |
| 100 | |
| 101 | # Open once and read many times |
| 102 | with pymupdf.open(path) as new_doc: |
| 103 | for i in range(10): |
| 104 | new_doc.get_toc() |
| 105 | |
| 106 | def test_2788(): |
| 107 | ''' |