summaryrefslogtreecommitdiff
path: root/tests/test_regexopt.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-20 10:40:11 +0200
committerGeorg Brandl <georg@python.org>2014-09-20 10:40:11 +0200
commit653009f0f5fdc7d70610d12c7fd05e68d4e0af59 (patch)
tree75e0cd72f1bdfca92d14164ef0396c182bbc11f4 /tests/test_regexopt.py
parent952696b4733bbc36171bca11b488380662996490 (diff)
downloadpygments-653009f0f5fdc7d70610d12c7fd05e68d4e0af59.tar.gz
regexopt: return the uncompiled regex.
Diffstat (limited to 'tests/test_regexopt.py')
-rw-r--r--tests/test_regexopt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_regexopt.py b/tests/test_regexopt.py
index 5dc8f9af..743d4d72 100644
--- a/tests/test_regexopt.py
+++ b/tests/test_regexopt.py
@@ -7,6 +7,7 @@
:license: BSD, see LICENSE for details.
"""
+import re
import random
import unittest
import itertools
@@ -32,7 +33,7 @@ class RegexOptTestCase(unittest.TestCase):
to_match = random.sample(kwlist,
random.randint(1, len(kwlist) - 1))
no_match = set(kwlist) - set(to_match)
- rex = regex_opt(to_match, True)
+ rex = re.compile(regex_opt(to_match))
for w in to_match:
self.assertTrue(rex.match(w))
for w in no_match: