mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Make ReaderTest py2 and py3 compatible
This commit is contained in:
parent
8b299098c9
commit
2d84c04add
1 changed files with 6 additions and 2 deletions
|
|
@ -3,6 +3,8 @@ from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from pelican import readers
|
from pelican import readers
|
||||||
from pelican.tests.support import get_settings, unittest
|
from pelican.tests.support import get_settings, unittest
|
||||||
from pelican.utils import SafeDatetime
|
from pelican.utils import SafeDatetime
|
||||||
|
|
@ -55,7 +57,8 @@ class TestAssertDictHasSubset(ReaderTest):
|
||||||
self.assertDictHasSubset(self.dictionary, self.dictionary)
|
self.assertDictHasSubset(self.dictionary, self.dictionary)
|
||||||
|
|
||||||
def test_fail_not_set(self):
|
def test_fail_not_set(self):
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
AssertionError,
|
AssertionError,
|
||||||
'Expected.*key-c.*to have value.*val-c.*but was not in Dict',
|
'Expected.*key-c.*to have value.*val-c.*but was not in Dict',
|
||||||
self.assertDictHasSubset,
|
self.assertDictHasSubset,
|
||||||
|
|
@ -63,7 +66,8 @@ class TestAssertDictHasSubset(ReaderTest):
|
||||||
{'key-c': 'val-c'})
|
{'key-c': 'val-c'})
|
||||||
|
|
||||||
def test_fail_wrong_val(self):
|
def test_fail_wrong_val(self):
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
AssertionError,
|
AssertionError,
|
||||||
'Expected .*key-a.* to have value .*val-b.* but was .*val-a.*',
|
'Expected .*key-a.* to have value .*val-b.* but was .*val-a.*',
|
||||||
self.assertDictHasSubset,
|
self.assertDictHasSubset,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue