Lines Matching defs:path
5 import os.path
19 OS_PATH_NAME = os.path.__name__
81 path = [os.path.dirname(__file__)]
83 imp.find_module('badsyntax_pep3120', path)
106 sys.path.insert(0, '.')
114 del sys.path[0]
158 init_file_name = os.path.join(test_package_name, '__init__.py')
160 # if the curdir is not in sys.path the test fails when run with
162 sys.path.insert(0, os.curdir)
189 if not os.path.exists(test_package_name):
198 del sys.path[0]
206 path = os.path.dirname(__file__)
208 imp.find_module, "badsyntax_pep3120", [path])
219 with import_helper.CleanImport('os', 'os.path', OS_PATH_NAME):
221 orig_path = os.path
228 self.assertIs(orig_path, new_os.path)
260 # Issue #1559549 added `name` and `path` attributes to ImportError
263 path = 'bogus file path'
266 imp.load_dynamic(name, path)
267 self.assertIn(path, err.exception.path)
382 file, path, description = imp.find_module('mymod', path=['.'])
383 mod = imp.load_module('mymod', file, path, description)
462 # Given the path to a .py file, return the path to its PEP 3147
464 path = os.path.join('foo', 'bar', 'baz', 'qux.py')
465 expect = os.path.join('foo', 'bar', 'baz', '__pycache__',
467 self.assertEqual(imp.cache_from_source(path, True), expect)
473 # Given the path to a PEP 3147 defined .pyc file, return the path to
474 # its source. This tests the good path.
475 path = os.path.join('foo', 'bar', 'baz', '__pycache__',
477 expect = os.path.join('foo', 'bar', 'baz', 'qux.py')
478 self.assertEqual(imp.source_from_cache(path), expect)