Move the BupSubprocTestRunner.runtest() check for skipped tests to the
end. Previously it would act before the check for failures and report
the entire test file as skipped, rather than failed.
Thanks to Johannes Berg for reporting the problem and proposing the
solution.
Signed-off-by: Rob Browning <
r...@defaultvalue.org>
Tested-by: Rob Browning <
r...@defaultvalue.org>
---
Pushed to main.
test/ext/conftest.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/ext/conftest.py b/test/ext/conftest.py
index c5f80d5b..4f6c1e70 100644
--- a/test/ext/conftest.py
+++ b/test/ext/conftest.py
@@ -36,11 +36,6 @@ class BupSubprocTestRunner(pytest.Item):
sys.stdout.flush()
byte_stream(sys.stdout).write(out)
lines = out.splitlines()
- for line in lines:
- if line.startswith(b'!') and line.lower().endswith(b' skip ok'):
- # drop the leading file/line, etc. and trailing skip ok
- pytest.skip(line.decode('utf-8').split(maxsplit=2)[-1][:-8])
- return
failures = [line for line in lines
if (line.startswith(b'!')
and line.lower().endswith(b' failed'))]
@@ -50,6 +45,11 @@ class BupSubprocTestRunner(pytest.Item):
raise BupSubprocFailure('%s failed (exit %d, %d failures)'
% (cmd, p.returncode, len(failures)),
p.returncode, failures)
+ for line in lines:
+ if line.startswith(b'!') and line.lower().endswith(b' skip ok'):
+ # drop the leading file/line, etc. and trailing skip ok
+ pytest.skip(line.decode('utf-8').split(maxsplit=2)[-1][:-8])
+ return
def repr_failure(self, excinfo, style=None):
# We ignore the style, which appears to be one of None,
--
2.47.3