Mercurial > p > roundup > code
diff test/db_test_base.py @ 5376:64b05e24dbd8
Python 3 preparation: convert print to a function.
Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 09:54:52 +0000 |
| parents | c5e72a3c69dd |
| children | 0942fe89e82e |
line wrap: on
line diff
--- a/test/db_test_base.py Sat Jul 21 23:07:16 2018 +1000 +++ b/test/db_test_base.py Tue Jul 24 09:54:52 2018 +0000 @@ -15,6 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +from __future__ import print_function import unittest, os, shutil, errno, imp, sys, time, pprint, base64, os.path import logging, cgi import gpgmelib @@ -1048,7 +1049,7 @@ # check history including quiet properties result=self.db.issue.history(new_issue, skipquiet=False) - print result + print(result) ''' output should be like: [ ... ('1', <Date 2017-04-14.01:41:08.466>, '1', 'set', {'assignedto': None, 'nosy': (('+', ['3', '2']),), @@ -1061,7 +1062,7 @@ 'title': 'title'} result.sort() - print "history include quiet props", result[-1] + print("history include quiet props", result[-1]) (id, tx_date, user, action, args) = result[-1] # check piecewise ignoring date of transaction self.assertEqual('1', id) @@ -1078,7 +1079,7 @@ expected = {'title': 'title'} result.sort() - print "history remove quiet props", result[-1] + print("history remove quiet props", result[-1]) (id, tx_date, user, action, args) = result[-1] # check piecewise self.assertEqual('1', id) @@ -1112,7 +1113,7 @@ 'deadline': date.Date("2016-07-30.22:39:00.000")} result.sort() - print "result unquiet", result + print("result unquiet", result) (id, tx_date, user, action, args) = result[-1] # check piecewise self.assertEqual('1', id) @@ -3378,7 +3379,7 @@ # does a commit of the otk to the database. cl.inner_main() cl.db.close() - print self.out + print(self.out) # Make sure the action was called self.assertEqual(SpecialAction.x, True) # Check that the Reject worked:
