mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
#1648: add sys.gettrace() and sys.getprofile().
This commit is contained in:
parent
92058d2933
commit
56112895d6
5 changed files with 104 additions and 0 deletions
|
|
@ -268,6 +268,20 @@ class TraceTestCase(unittest.TestCase):
|
|||
self.compare_events(func.func_code.co_firstlineno,
|
||||
tracer.events, func.events)
|
||||
|
||||
def set_and_retrieve_none(self):
|
||||
sys.settrace(None)
|
||||
assert sys.gettrace() is None
|
||||
|
||||
def set_and_retrieve_func(self):
|
||||
def fn(*args):
|
||||
pass
|
||||
|
||||
sys.settrace(fn)
|
||||
try:
|
||||
assert sys.gettrace() is fn
|
||||
finally:
|
||||
sys.settrace(None)
|
||||
|
||||
def test_01_basic(self):
|
||||
self.run_test(basic)
|
||||
def test_02_arigo(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue