~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Lib/test/test_pkgutil.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
    def setUp(self):
17
17
        self.dirname = tempfile.mkdtemp()
 
18
        self.addCleanup(shutil.rmtree, self.dirname)
18
19
        sys.path.insert(0, self.dirname)
19
20
 
20
21
    def tearDown(self):
21
22
        del sys.path[0]
22
 
        shutil.rmtree(self.dirname)
23
23
 
24
24
    def test_getdata_filesys(self):
25
25
        pkg = 'test_getdata_filesys'
84
84
 
85
85
        del sys.modules[pkg]
86
86
 
 
87
    def test_unreadable_dir_on_syspath(self):
 
88
        # issue7367 - walk_packages failed if unreadable dir on sys.path
 
89
        package_name = "unreadable_package"
 
90
        d = os.path.join(self.dirname, package_name)
 
91
        # this does not appear to create an unreadable dir on Windows
 
92
        #   but the test should not fail anyway
 
93
        os.mkdir(d, 0)
 
94
        self.addCleanup(os.rmdir, d)
 
95
        for t in pkgutil.walk_packages(path=[self.dirname]):
 
96
            self.fail("unexpected package found")
 
97
 
87
98
class PkgutilPEP302Tests(unittest.TestCase):
88
99
 
89
100
    class MyTestLoader(object):