File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,25 @@ def get_members(a):
7777 # Allow post-test checking that pymupdf._globals has not changed.
7878 _globals_pre = get_members (pymupdf ._globals )
7979
80+ testsfailed_before = request .session .testsfailed
81+
8082 # Run the test.
8183 rep = yield
8284
8385 sys .stdout .flush ()
8486
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
98+
8599 # Test has run; check it did not create any MuPDF warnings etc.
86100 wt = pymupdf .TOOLS .mupdf_warnings ()
87101 if not hasattr (pymupdf , 'mupdf' ):
You can’t perform that action at this time.
0 commit comments