Skip to content

Commit 6f1077d

Browse files
committed
patch unittest.TestCase.assertRegex for py27
1 parent 397ed72 commit 6f1077d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/pdfkit-tests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import unittest
77

88

9+
if sys.version_info[0] == 2 and sys.version_info[1] == 7:
10+
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
11+
12+
913
#Prepend ../ to PYTHONPATH so that we can import PDFKIT form there.
1014
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
1115
sys.path.insert(0, os.path.realpath(os.path.join(TESTS_ROOT, '..')))
@@ -80,9 +84,9 @@ def test_options_parsing_with_tuple_no_dashes(self):
8084
def test_repeatable_options(self):
8185
roptions = {
8286
'--page-size': 'Letter',
83-
'cookies': [
87+
'cookies': [
8488
('test_cookie1','cookie_value1'),
85-
('test_cookie2','cookie_value2'),
89+
('test_cookie2','cookie_value2'),
8690
]
8791
}
8892

0 commit comments

Comments
 (0)