Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_modulefinder.py

    r2 r391  
    212212def create_package(source):
    213213    ofi = None
    214     for line in source.splitlines():
    215         if line.startswith(" ") or line.startswith("\t"):
    216             ofi.write(line.strip() + "\n")
    217         else:
    218             ofi = open_file(os.path.join(TEST_DIR, line.strip()))
     214    try:
     215        for line in source.splitlines():
     216            if line.startswith(" ") or line.startswith("\t"):
     217                ofi.write(line.strip() + "\n")
     218            else:
     219                if ofi:
     220                    ofi.close()
     221                ofi = open_file(os.path.join(TEST_DIR, line.strip()))
     222    finally:
     223        if ofi:
     224            ofi.close()
    219225
    220226class ModuleFinderTest(unittest.TestCase):
     
    241247            less = list(modules - found)
    242248            # check if we found what we expected, not more, not less
    243             self.failUnlessEqual((more, less), ([], []))
     249            self.assertEqual((more, less), ([], []))
    244250
    245251            # check for missing and maybe missing modules
    246252            bad, maybe = mf.any_missing_maybe()
    247             self.failUnlessEqual(bad, missing)
    248             self.failUnlessEqual(maybe, maybe_missing)
     253            self.assertEqual(bad, missing)
     254            self.assertEqual(maybe, maybe_missing)
    249255        finally:
    250256            distutils.dir_util.remove_tree(TEST_DIR)
Note: See TracChangeset for help on using the changeset viewer.