Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
diff --git a/Lib/test/test_profilehooks.py b/Lib/test/test_profilehooks.py
index 8990e2c..75599d9 100644
--- a/Lib/test/test_profilehooks.py
+++ b/Lib/test/test_profilehooks.py
@@ -1,10 +1,8 @@
-from test_support import TestFailed
-
import pprint
import sys
import unittest
-import test_support
+from test import test_support
class HookWatcher:
@@ -329,9 +327,13 @@
def capture_events(callable, p=None):
- try: sys.setprofile()
- except TypeError: pass
- else: raise TestFailed, 'sys.setprofile() did not raise TypeError'
+ try:
+ sys.setprofile()
+ except TypeError:
+ pass
+ else:
+ raise test_support.TestFailed(
+ 'sys.setprofile() did not raise TypeError')
if p is None:
p = HookWatcher()