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

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

Date: Sun, 25 Mar 2018 14:40:34 -0300

To: Justus Winter, Floris Bruynooghe, David Bremner, W. Trevor King

Cc: notmuch@notmuchmail.org

From: David Bremner


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

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: