diff options
author | Georg Brandl <georg@python.org> | 2008-01-20 13:59:46 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-20 13:59:46 +0000 |
commit | 56112895d69131ee4f34d4e3e9406614313df57f (patch) | |
tree | b57e176cd54df7984553c6337390ce1712fb2292 /Lib/test/test_profilehooks.py | |
parent | 92058d29334fcb4d01ae2ab7c165aba2ef6da2af (diff) | |
download | cpython-git-56112895d69131ee4f34d4e3e9406614313df57f.tar.gz |
#1648: add sys.gettrace() and sys.getprofile().
Diffstat (limited to 'Lib/test/test_profilehooks.py')
-rw-r--r-- | Lib/test/test_profilehooks.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_profilehooks.py b/Lib/test/test_profilehooks.py index 53f882a3fe..2eedfd92e9 100644 --- a/Lib/test/test_profilehooks.py +++ b/Lib/test/test_profilehooks.py @@ -4,6 +4,22 @@ import unittest from test import test_support +class TestGetProfile(unittest.TestCase): + def setUp(self): + sys.setprofile(None) + + def tearDown(self): + sys.setprofile(None) + + def test_empty(self): + assert sys.getprofile() == None + + def test_setget(self): + def fn(*args): + pass + + sys.setprofile(fn) + assert sys.getprofile() == fn class HookWatcher: def __init__(self): @@ -359,6 +375,7 @@ def show_events(callable): def test_main(): test_support.run_unittest( + TestGetProfile, ProfileHookTestCase, ProfileSimulatorTestCase ) |