Do not expect line number events when running under "python -O".

The right fix is to generate line number events anyway ;-), but this will
have to do for now.
This commit is contained in:
Fred Drake 2001-10-18 19:34:00 +00:00
parent 397a654791
commit c10039c011

View File

@ -53,6 +53,9 @@ class HotShotTestCase(unittest.TestCase):
def check_events(self, expected):
events = self.get_events_wotime()
if not __debug__:
# Running under -O, so we don't get LINE events
expected = [ev for ev in expected if ev[0] != LINE]
if events != expected:
self.fail(
"events did not match expectation; got:\n%s\nexpected:\n%s"