summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2015-07-16 04:41:47 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2015-07-16 04:41:47 (GMT)
commit8e11d7f20459697c883df1e421df02006f749792 (patch) (side-by-side diff)
tree9ff24bccbb840535590e2985f45f4205e44244c2
parent45b2027439e96c366e188a12bd831802d30bbddc (diff)
downloadwit-8e11d7f20459697c883df1e421df02006f749792.tar.gz
wit-8e11d7f20459697c883df1e421df02006f749792.tar.bz2
Fix test.py to work with Python 3
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--test.py40
1 files changed, 21 insertions, 19 deletions
diff --git a/test.py b/test.py
index e82a46d..9c72832 100644
--- a/test.py
+++ b/test.py
@@ -15,77 +15,78 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import print_function
import unittest
import wiki2html
class TestMarkupParserBasic (unittest.TestCase):
def test_colon(self):
- self.assert_(self.__test('colon'))
+ self.assertTrue(self.__test('colon'))
pass
def test_headings(self):
- self.assert_(self.__test('headings'))
+ self.assertTrue(self.__test('headings'))
pass
def test_hz(self):
- self.assert_(self.__test('hz'))
+ self.assertTrue(self.__test('hz'))
pass
def test_numlist(self):
- self.assert_(self.__test('numlist'))
+ self.assertTrue(self.__test('numlist'))
pass
def test_unlist(self):
- self.assert_(self.__test('unlist'))
+ self.assertTrue(self.__test('unlist'))
pass
def test_deflist(self):
- self.assert_(self.__test('deflist'))
+ self.assertTrue(self.__test('deflist'))
pass
def test_para(self):
- self.assert_(self.__test('para'))
+ self.assertTrue(self.__test('para'))
pass
def test_it(self):
- self.assert_(self.__test('it'))
+ self.assertTrue(self.__test('it'))
pass
def test_bold(self):
- self.assert_(self.__test('bold'))
+ self.assertTrue(self.__test('bold'))
pass
def test_boldit1(self):
- self.assert_(self.__test('boldit1'))
+ self.assertTrue(self.__test('boldit1'))
pass
def test_itbold1(self):
- self.assert_(self.__test('itbold1'))
+ self.assertTrue(self.__test('itbold1'))
pass
def test_boldit2(self):
- self.assert_(self.__test('boldit2'))
+ self.assertTrue(self.__test('boldit2'))
pass
def test_itbold2(self):
- self.assert_(self.__test('itbold2'))
+ self.assertTrue(self.__test('itbold2'))
pass
def test_boldit3(self):
- self.assert_(self.__test('boldit3'))
+ self.assertTrue(self.__test('boldit3'))
pass
def test_itbold3(self):
- self.assert_(self.__test('itbold3'))
+ self.assertTrue(self.__test('itbold3'))
pass
# def test_door(self):
- # self.assert_(self.__test('door'))
+ # self.assertTrue(self.__test('door'))
# pass
# def test_drzwi(self):
- # self.assert_(self.__test('drzwi'))
+ # self.assertTrue(self.__test('drzwi'))
# pass
def __test(self, filename):
@@ -93,6 +94,7 @@ class TestMarkupParserBasic (unittest.TestCase):
name_out = 'testdata/' + filename + '.html'
fh = open(name_out)
buf = ''.join(fh.readlines()).strip()
+ fh.close()
hwm = wiki2html.HtmlWiktionaryMarkup(filename=name_in, lang="pl")
hwm.parse()
@@ -100,8 +102,8 @@ class TestMarkupParserBasic (unittest.TestCase):
return True
# fail
- print "\n>>>%s<<<" % buf
- print ">>>%s<<<" % str(hwm).strip()
+ print("\n>>>%s<<<" % buf)
+ print(">>>%s<<<" % str(hwm).strip())
return False
if __name__ == '__main__':

Return to:

Send suggestions and report system problems to the System administrator.