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