Changeset 391 for python/trunk/Lib/test/test_pkg.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_pkg.py
r2 r391 52 52 def tearDown(self): 53 53 sys.path[:] = self.syspath 54 cleanout(self.root) 55 56 # delete all modules concerning the tested hiearchy 54 if self.root: # Only clean if the test was actually run 55 cleanout(self.root) 56 57 # delete all modules concerning the tested hierarchy 57 58 if self.pkgname: 58 59 modules = [name for name in sys.modules … … 102 103 self.mkhier(hier) 103 104 104 import t2105 self.assertEqual(t2.__doc__, "doc for t2")106 107 105 import t2.sub 108 106 import t2.sub.subsub … … 127 125 self.assertEqual(sub.subsub.__name__, "t2.sub.subsub") 128 126 for name in ['spam', 'sub', 'subsub', 't2']: 129 self. failUnless(locals()["name"], "Failed to import %s" % name)127 self.assertTrue(locals()["name"], "Failed to import %s" % name) 130 128 131 129 import t2.sub … … 137 135 s = """ 138 136 from t2 import * 139 self. failUnless(dir(), ['self', 'sub'])137 self.assertTrue(dir(), ['self', 'sub']) 140 138 """ 141 139 self.run_code(s) … … 255 253 ['__doc__', '__file__', '__name__', 256 254 '__package__', '__path__']) 257 self. failIf(t7)255 self.assertFalse(t7) 258 256 from t7 import sub as subpar 259 257 self.assertEqual(fixdir(dir(subpar)), 260 258 ['__doc__', '__file__', '__name__', 261 259 '__package__', '__path__']) 262 self. failIf(t7)263 self. failIf(sub)260 self.assertFalse(t7) 261 self.assertFalse(sub) 264 262 from t7.sub import subsub as subsubsub 265 263 self.assertEqual(fixdir(dir(subsubsub)), 266 264 ['__doc__', '__file__', '__name__', 267 265 '__package__', '__path__', 'spam']) 268 self. failIf(t7)269 self. failIf(sub)270 self. failIf(subsub)266 self.assertFalse(t7) 267 self.assertFalse(sub) 268 self.assertFalse(subsub) 271 269 from t7.sub.subsub import spam as ham 272 270 self.assertEqual(ham, 1) 273 self.failIf(t7) 274 self.failIf(sub) 275 self.failIf(subsub) 276 271 self.assertFalse(t7) 272 self.assertFalse(sub) 273 self.assertFalse(subsub) 274 275 @unittest.skipIf(sys.flags.optimize >= 2, 276 "Docstrings are omitted with -O2 and above") 277 def test_8(self): 278 hier = [ 279 ("t8", None), 280 ("t8 __init__"+os.extsep+"py", "'doc for t8'"), 281 ] 282 self.mkhier(hier) 283 284 import t8 285 self.assertEqual(t8.__doc__, "doc for t8") 277 286 278 287 def test_main():
Note:
See TracChangeset
for help on using the changeset viewer.