mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix failures in test_profilehooks when run with -3
This commit is contained in:
parent
79d923b8c4
commit
bb86314d22
1 changed files with 13 additions and 13 deletions
|
@ -110,7 +110,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_exception(self):
|
def test_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
1/0
|
1./0
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
(1, 'return', f_ident),
|
(1, 'return', f_ident),
|
||||||
|
@ -118,7 +118,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_caught_exception(self):
|
def test_caught_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
try: 1/0
|
try: 1./0
|
||||||
except: pass
|
except: pass
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
|
@ -127,7 +127,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_caught_nested_exception(self):
|
def test_caught_nested_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
try: 1/0
|
try: 1./0
|
||||||
except: pass
|
except: pass
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
|
@ -136,7 +136,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_nested_exception(self):
|
def test_nested_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
1/0
|
1./0
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
# This isn't what I expected:
|
# This isn't what I expected:
|
||||||
|
@ -147,7 +147,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_exception_in_except_clause(self):
|
def test_exception_in_except_clause(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
1/0
|
1./0
|
||||||
def g(p):
|
def g(p):
|
||||||
try:
|
try:
|
||||||
f(p)
|
f(p)
|
||||||
|
@ -166,7 +166,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_exception_propogation(self):
|
def test_exception_propogation(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
1/0
|
1./0
|
||||||
def g(p):
|
def g(p):
|
||||||
try: f(p)
|
try: f(p)
|
||||||
finally: p.add_event("falling through")
|
finally: p.add_event("falling through")
|
||||||
|
@ -181,8 +181,8 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_raise_twice(self):
|
def test_raise_twice(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
try: 1/0
|
try: 1./0
|
||||||
except: 1/0
|
except: 1./0
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
(1, 'return', f_ident),
|
(1, 'return', f_ident),
|
||||||
|
@ -190,7 +190,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_raise_reraise(self):
|
def test_raise_reraise(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
try: 1/0
|
try: 1./0
|
||||||
except: raise
|
except: raise
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
|
@ -207,7 +207,7 @@ class ProfileHookTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_distant_exception(self):
|
def test_distant_exception(self):
|
||||||
def f():
|
def f():
|
||||||
1/0
|
1./0
|
||||||
def g():
|
def g():
|
||||||
f()
|
f()
|
||||||
def h():
|
def h():
|
||||||
|
@ -292,7 +292,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_basic_exception(self):
|
def test_basic_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
1/0
|
1./0
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
(1, 'return', f_ident),
|
(1, 'return', f_ident),
|
||||||
|
@ -300,7 +300,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_caught_exception(self):
|
def test_caught_exception(self):
|
||||||
def f(p):
|
def f(p):
|
||||||
try: 1/0
|
try: 1./0
|
||||||
except: pass
|
except: pass
|
||||||
f_ident = ident(f)
|
f_ident = ident(f)
|
||||||
self.check_events(f, [(1, 'call', f_ident),
|
self.check_events(f, [(1, 'call', f_ident),
|
||||||
|
@ -309,7 +309,7 @@ class ProfileSimulatorTestCase(TestCaseBase):
|
||||||
|
|
||||||
def test_distant_exception(self):
|
def test_distant_exception(self):
|
||||||
def f():
|
def f():
|
||||||
1/0
|
1./0
|
||||||
def g():
|
def g():
|
||||||
f()
|
f()
|
||||||
def h():
|
def h():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue