From 653009f0f5fdc7d70610d12c7fd05e68d4e0af59 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 20 Sep 2014 10:40:11 +0200 Subject: regexopt: return the uncompiled regex. --- tests/test_regexopt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test_regexopt.py') 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: -- cgit v1.2.1