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) (ignore 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
@@ -17,2 +17,3 @@
+from __future__ import print_function
import unittest
@@ -23,3 +24,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_colon(self):
- self.assert_(self.__test('colon'))
+ self.assertTrue(self.__test('colon'))
pass
@@ -27,3 +28,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_headings(self):
- self.assert_(self.__test('headings'))
+ self.assertTrue(self.__test('headings'))
pass
@@ -31,3 +32,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_hz(self):
- self.assert_(self.__test('hz'))
+ self.assertTrue(self.__test('hz'))
pass
@@ -35,3 +36,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_numlist(self):
- self.assert_(self.__test('numlist'))
+ self.assertTrue(self.__test('numlist'))
pass
@@ -39,3 +40,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_unlist(self):
- self.assert_(self.__test('unlist'))
+ self.assertTrue(self.__test('unlist'))
pass
@@ -43,3 +44,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_deflist(self):
- self.assert_(self.__test('deflist'))
+ self.assertTrue(self.__test('deflist'))
pass
@@ -47,3 +48,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_para(self):
- self.assert_(self.__test('para'))
+ self.assertTrue(self.__test('para'))
pass
@@ -51,3 +52,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_it(self):
- self.assert_(self.__test('it'))
+ self.assertTrue(self.__test('it'))
pass
@@ -55,3 +56,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_bold(self):
- self.assert_(self.__test('bold'))
+ self.assertTrue(self.__test('bold'))
pass
@@ -59,3 +60,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_boldit1(self):
- self.assert_(self.__test('boldit1'))
+ self.assertTrue(self.__test('boldit1'))
pass
@@ -63,3 +64,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_itbold1(self):
- self.assert_(self.__test('itbold1'))
+ self.assertTrue(self.__test('itbold1'))
pass
@@ -67,3 +68,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_boldit2(self):
- self.assert_(self.__test('boldit2'))
+ self.assertTrue(self.__test('boldit2'))
pass
@@ -71,3 +72,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_itbold2(self):
- self.assert_(self.__test('itbold2'))
+ self.assertTrue(self.__test('itbold2'))
pass
@@ -75,3 +76,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_boldit3(self):
- self.assert_(self.__test('boldit3'))
+ self.assertTrue(self.__test('boldit3'))
pass
@@ -79,3 +80,3 @@ class TestMarkupParserBasic (unittest.TestCase):
def test_itbold3(self):
- self.assert_(self.__test('itbold3'))
+ self.assertTrue(self.__test('itbold3'))
pass
@@ -83,3 +84,3 @@ class TestMarkupParserBasic (unittest.TestCase):
# def test_door(self):
- # self.assert_(self.__test('door'))
+ # self.assertTrue(self.__test('door'))
# pass
@@ -87,3 +88,3 @@ class TestMarkupParserBasic (unittest.TestCase):
# def test_drzwi(self):
- # self.assert_(self.__test('drzwi'))
+ # self.assertTrue(self.__test('drzwi'))
# pass
@@ -95,2 +96,3 @@ class TestMarkupParserBasic (unittest.TestCase):
buf = ''.join(fh.readlines()).strip()
+ fh.close()
hwm = wiki2html.HtmlWiktionaryMarkup(filename=name_in, lang="pl")
@@ -102,4 +104,4 @@ class TestMarkupParserBasic (unittest.TestCase):
# fail
- print "\n>>>%s<<<" % buf
- print ">>>%s<<<" % str(hwm).strip()
+ print("\n>>>%s<<<" % buf)
+ print(">>>%s<<<" % str(hwm).strip())
return False

Return to:

Send suggestions and report system problems to the System administrator.