diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_profilehooks.py | 6 | ||||
-rw-r--r-- | Lib/test/test_scope.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_profilehooks.py b/Lib/test/test_profilehooks.py index cc97df8..fa38d30 100644 --- a/Lib/test/test_profilehooks.py +++ b/Lib/test/test_profilehooks.py @@ -1,5 +1,7 @@ from __future__ import generators +from test_support import TestFailed + import pprint import sys import unittest @@ -329,6 +331,10 @@ protect_ident = ident(protect) def capture_events(callable, p=None): + try: sys.setprofile() + except TypeError: pass + else: raise TestFailed, 'sys.setprofile() did not raise TypeError' + if p is None: p = HookWatcher() sys.setprofile(p.callback) diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py index bb29f8b..85cfed4 100644 --- a/Lib/test/test_scope.py +++ b/Lib/test/test_scope.py @@ -471,6 +471,10 @@ sys.settrace(tracer) adaptgetter("foo", TestClass, (1, "")) sys.settrace(None) +try: sys.settrace() +except TypeError: pass +else: raise TestFailed, 'sys.settrace() did not raise TypeError' + print "20. eval and exec with free variables" def f(x): |