File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 20
20
from functools import partial
21
21
from mock import patch
22
22
import os
23
+ import sys
23
24
24
25
from test import _common
25
26
from test ._common import unittest
@@ -305,8 +306,12 @@ def test_invalid_query(self):
305
306
306
307
with self .assertRaises (InvalidQueryArgumentTypeError ) as raised :
307
308
dbcore .query .RegexpQuery ('year' , u'199(' )
308
- self .assertIn (u'not a regular expression' , unicode (raised .exception ))
309
- self .assertIn (u'unbalanced parenthesis' , unicode (raised .exception ))
309
+ exception_text = unicode (raised .exception )
310
+ self .assertIn (u'not a regular expression' , exception_text )
311
+ if sys .version_info >= (3 , 5 ):
312
+ self .assertIn (u'unterminated subpattern' , exception_text )
313
+ else :
314
+ self .assertIn (u'unbalanced parenthesis' , exception_text )
310
315
self .assertIsInstance (raised .exception , ParsingError )
311
316
312
317
You can’t perform that action at this time.
0 commit comments