[PATCH 2/3] test: add new test_expect_pytest_success

Subject:[PATCH 2/3] test: add new test_expect_pytest_success

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

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

Cc:notmuch@notmuchmail.org

From:David Bremner


As the name suggests, this is something of a cross between
test_python (reading a script from stdin) and test expect success.

It seemed somewhat redundant to allow our usual kind of file
comparison with pytest scripts, although that will make it tougher to
compare output with the CLI.
---
 test/test-lib.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 5b212514..fd0e9647 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1002,6 +1002,13 @@ test_python() {
 	$NOTMUCH_PYTHON -B - > OUTPUT
 }
 
+test_expect_pytest_success() {
+    test_file="test_${test_count}.py"
+    cat > ${test_file}
+    PYTHONPATH="$NOTMUCH_SRCDIR/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \
+              test_expect_success "$NOTMUCH_PYTEST ${test_file}"
+}
+
 test_ruby() {
     MAIL_DIR=$MAIL_DIR ruby -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
 }
-- 
2.16.2

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

Thread: