Mercurial > hgrepos > Python2 > PyMuPDF
comparison tests/conftest.py @ 41:71bcc18e306f
MERGE: New upstream PyMuPDF v1.26.5 including MuPDF v1.26.10
BUGS: Needs some additional changes yet.
Not yet tested.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 11 Oct 2025 15:24:40 +0200 |
| parents | a6bc019ac0b2 |
| children |
comparison
equal
deleted
inserted
replaced
| 38:8934ac156ef5 | 41:71bcc18e306f |
|---|---|
| 75 return ret | 75 return ret |
| 76 | 76 |
| 77 # Allow post-test checking that pymupdf._globals has not changed. | 77 # Allow post-test checking that pymupdf._globals has not changed. |
| 78 _globals_pre = get_members(pymupdf._globals) | 78 _globals_pre = get_members(pymupdf._globals) |
| 79 | 79 |
| 80 testsfailed_before = request.session.testsfailed | |
| 81 | |
| 80 # Run the test. | 82 # Run the test. |
| 81 rep = yield | 83 rep = yield |
| 82 | 84 |
| 83 sys.stdout.flush() | 85 sys.stdout.flush() |
| 86 | |
| 87 # This seems the only way for us to tell that a test has failed. In | |
| 88 # particular, <rep> is always None. We're implicitly relying on tests not | |
| 89 # being run in parallel. | |
| 90 # | |
| 91 failed = request.session.testsfailed - testsfailed_before | |
| 92 assert failed in (0, 1) | |
| 93 | |
| 94 if failed: | |
| 95 # Do not check post-test conditions if the test as failed. This avoids | |
| 96 # additional confusing `ERROR` status for failed tests. | |
| 97 return | |
| 84 | 98 |
| 85 # Test has run; check it did not create any MuPDF warnings etc. | 99 # Test has run; check it did not create any MuPDF warnings etc. |
| 86 wt = pymupdf.TOOLS.mupdf_warnings() | 100 wt = pymupdf.TOOLS.mupdf_warnings() |
| 87 if not hasattr(pymupdf, 'mupdf'): | 101 if not hasattr(pymupdf, 'mupdf'): |
| 88 print(f'Not checking mupdf_warnings on classic.') | 102 print(f'Not checking mupdf_warnings on classic.') |
