[PATCH 1/1] pytest: omit prefix and suffix from test/ext wvskip messages

3 views
Skip to first unread message

Rob Browning

unread,
Mar 13, 2026, 5:36:46 PM (20 hours ago) Mar 13
to bup-...@googlegroups.com
Changes xdev skip message from, for example

SKIPPED (! /home/rlb/src/bup/main/test/ext/test-xdev:9 no...)

to

SKIPPED (not root: skipping tests)

...and expand what's allowed from ascii to utf-8.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Pushed to main.

test/ext/conftest.py | 3 ++-
test/ext/test-xdev | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/ext/conftest.py b/test/ext/conftest.py
index f4e412b4..f98342a2 100644
--- a/test/ext/conftest.py
+++ b/test/ext/conftest.py
@@ -40,7 +40,8 @@ class BupSubprocTestRunner(pytest.Item):
lines = out.splitlines()
for line in lines:
if line.startswith(b'!') and line.lower().endswith(b' skip ok'):
- pytest.skip(line.decode('ascii'))
+ # 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'!')
diff --git a/test/ext/test-xdev b/test/ext/test-xdev
index cfa303e4..52619e59 100755
--- a/test/ext/test-xdev
+++ b/test/ext/test-xdev
@@ -6,14 +6,14 @@ set -o pipefail
root_status="$(dev/root-status)" || exit $?

if [ "$root_status" != root ]; then
- WVSKIP 'not root: skipping tests'
+ WVSKIP 'not root'
exit 0
fi

# These tests are only likely to work under Linux for now
# (patches welcome).
if ! [[ $(uname) =~ Linux ]]; then
- WVSKIP 'not Linux: skipping tests'
+ WVSKIP 'not Linux'
exit 0
fi

@@ -41,7 +41,7 @@ mount -o loop testfs-1.img src/mnt-1
rc=$?
set +x
if test "$rc" -ne 0; then
- WVSKIP 'Unable to mount via loopback: skipping xdev tests.'
+ WVSKIP 'Unable to mount via loopback'
exit 0
fi

--
2.47.3

Reply all
Reply to author
Forward
0 new messages