[PATCH 3/3] test: add example test using pytest

David Bremner david at tethera.net
Sun Mar 25 10:40:34 PDT 2018


It might make sense to remove the non-pytest version of this test, but
that requires other changes to following tests
---
 test/T390-python.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/T390-python.sh b/test/T390-python.sh
index 9f71ce3c..72036004 100755
--- a/test/T390-python.sh
+++ b/test/T390-python.sh
@@ -194,4 +194,16 @@ EOF
 echo "$fname" > EXPECTED
 test_expect_equal_file EXPECTED OUTPUT
 
+if [ -n "${NOTMUCH_PYTEST}" ]; then
+
+    test_begin_subtest "pytest based get_revision"
+    test_expect_pytest_success <<EOF
+import notmuch
+def test_get_revision():
+    db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
+    (revision, uuid) = db.get_revision()
+    assert revision == 55
+EOF
+
+fi
 test_done
-- 
2.16.2



More information about the notmuch mailing list