72
72
self.assertEqual([('created regex', 'foo'),
73
73
('__getattr__', 'match'),
74
74
('_real_re_compile', ('foo',), {}),
77
77
def test_bad_pattern(self):
78
78
"""Ensure lazy regex handles bad patterns cleanly."""
79
79
p = lazy_regex.lazy_compile('RE:[')
80
80
# As p.match is lazy, we make it into a lambda so its handled
81
81
# by assertRaises correctly.
83
84
# Expect either old or new form of error message
84
85
self.assertContainsRe(e.msg, '^"RE:\\[" '
89
90
class TestLazyCompile(tests.TestCase):