aboutsummaryrefslogtreecommitdiff
path: root/test/T391-python-cffi.sh
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2023-12-01 07:51:09 -0400
committerDavid Bremner <bremner@debian.org>2023-12-01 07:51:09 -0400
commit126347b6942dd4b0291beb67b119431ebd750a2a (patch)
tree532c5163cb0972c8b9e6c8b4577b86afb9c6a6a2 /test/T391-python-cffi.sh
Import notmuch_0.38.2.orig.tar.xz
[dgit import orig notmuch_0.38.2.orig.tar.xz]
Diffstat (limited to 'test/T391-python-cffi.sh')
-rwxr-xr-xtest/T391-python-cffi.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/T391-python-cffi.sh b/test/T391-python-cffi.sh
new file mode 100755
index 00000000..0059b050
--- /dev/null
+++ b/test/T391-python-cffi.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+test_description="python bindings (pytest)"
+. $(dirname "$0")/test-lib.sh || exit 1
+
+if [ -n "${NOTMUCH_TEST_INSTALLED-}" ]; then
+ test_done
+fi
+
+if [ "${NOTMUCH_HAVE_PYTHON3_CFFI-0}" = "0" -o "${NOTMUCH_HAVE_PYTHON3_PYTEST-0}" = "0" ]; then
+ test_done
+fi
+
+test_begin_subtest "python cffi tests (NOTMUCH_CONFIG set)"
+pytest_dir=$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage
+printf "[pytest]\nminversion = 3.0\naddopts = -ra\n" > $pytest_dir/pytest.ini
+test_expect_success "(cd $pytest_dir && ${NOTMUCH_PYTHON} -m pytest --verbose --log-file=$TMP_DIRECTORY/test.output)"
+
+test_begin_subtest "python cffi tests (NOTMUCH_CONFIG unset)"
+pytest_dir=$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage
+printf "[pytest]\nminversion = 3.0\naddopts = -ra\n" > $pytest_dir/pytest.ini
+unset NOTMUCH_CONFIG
+test_expect_success "(cd $pytest_dir && ${NOTMUCH_PYTHON} -m pytest --verbose --log-file=$TMP_DIRECTORY/test.output)"
+test_done