Skip to content

Commit 34074b5

Browse files
author
Johnny Robeson
committed
check changed text on py >3.5 in RegexpQuery test
See https://bugs.python.org/issue22364 for details
1 parent cc6465d commit 34074b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/test_query.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from functools import partial
2121
from mock import patch
2222
import os
23+
import sys
2324

2425
from test import _common
2526
from test._common import unittest
@@ -305,8 +306,12 @@ def test_invalid_query(self):
305306

306307
with self.assertRaises(InvalidQueryArgumentTypeError) as raised:
307308
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)
310315
self.assertIsInstance(raised.exception, ParsingError)
311316

312317

0 commit comments

Comments
 (0)