1
0
Fork 0
forked from github/pelican

remove unittest2 and fix various warnings in py3

This commit is contained in:
Deniz Turgut 2013-04-13 16:36:05 -04:00
commit bc4bd773a0
10 changed files with 76 additions and 61 deletions

View file

@ -36,7 +36,9 @@ class TestWordpressXmlImporter(unittest.TestCase):
self.assertTrue(title.strip())
def test_can_toggle_raw_html_code_parsing(self):
r = lambda f: open(f).read()
def r(f):
with open(f) as infile:
return infile.read()
silent_f2p = mute(True)(fields2pelican)
with temporary_folder() as temp:
@ -76,7 +78,9 @@ class TestWordpressXmlImporter(unittest.TestCase):
self.assertEqual(decode_wp_content(encoded_content, br=False), decoded_content)
def test_preserve_verbatim_formatting(self):
r = lambda f: open(f).read()
def r(f):
with open(f) as infile:
return infile.read()
silent_f2p = mute(True)(fields2pelican)
test_post = filter(lambda p: p[0].startswith("Code in List"), self.posts)
with temporary_folder() as temp:
@ -89,7 +93,9 @@ class TestWordpressXmlImporter(unittest.TestCase):
self.assertTrue(for_line.rindex('for') < print_line.rindex('print'))
def test_code_in_list(self):
r = lambda f: open(f).read()
def r(f):
with open(f) as infile:
return infile.read()
silent_f2p = mute(True)(fields2pelican)
test_post = filter(lambda p: p[0].startswith("Code in List"), self.posts)
with temporary_folder() as temp: