[FIX] base: adapt test expectation to python 3.7

Compare exception message to the exact one raised in all versions.
This commit is contained in:
Christophe Simonis
2018-07-31 20:31:46 +02:00
parent 8c81eaabe6
commit cc0baa086a
+8 -5
View File
@@ -5,7 +5,6 @@ import collections
import json
import os.path
import re
import sys
from lxml import etree
@@ -481,12 +480,16 @@ class TestQWebNS(TransactionCase):
</t>
"""
})
error_msg = "Can't convert 'int' object to str implicitly"
if sys.version_info >= (3, 6):
error_msg = "must be str, not int"
with self.assertRaisesRegexp(QWebException, error_msg):
try:
"" + 0
except TypeError as e:
error_msg = e.args[0]
with self.assertRaises(QWebException, msg=error_msg):
view1.render()
from copy import deepcopy
class FileSystemLoader(object):
def __init__(self, path):