test: make python tests compatible with python3
authorDavid Bremner <david@tethera.net>
Sat, 23 May 2015 20:28:44 +0000 (22:28 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 8 Jun 2015 14:41:53 +0000 (16:41 +0200)
Making the test suite actually run them with python3 is left for
future work.

test/T390-python.sh

index 3f03a2e3a966018a273bdb75dece7fcc1b224ddd..26d0b97663dd91fba902b35a5854d0bd68490f87 100755 (executable)
@@ -11,7 +11,7 @@ db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
 q_new = notmuch.Query(db, 'tag:inbox')
 q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
 for t in q_new.search_threads():
-    print t.get_thread_id()
+    print (t.get_thread_id())
 EOF
 notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED
 test_expect_equal_file OUTPUT EXPECTED
@@ -23,7 +23,7 @@ db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
 q_new = notmuch.Query(db, 'tag:inbox')
 q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
 for m in q_new.search_messages():
-    print m.get_message_id()
+    print (m.get_message_id())
 EOF
 notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED
 test_expect_equal_file OUTPUT EXPECTED
@@ -32,7 +32,7 @@ test_begin_subtest "get non-existent file"
 test_python <<EOF
 import notmuch
 db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
-print db.find_message_by_filename("i-dont-exist")
+print (db.find_message_by_filename("i-dont-exist"))
 EOF
 test_expect_equal "$(cat OUTPUT)" "None"