Lines Matching full:depth
116 def _make_pkg(self, source, depth, mod_base="runpy_test"): argument
123 for i in range(depth):
133 mod_name = (pkg_name+".")*depth + mod_base
136 def _del_pkg(self, top, depth, mod_name): argument
161 def _check_module(self, depth): argument
163 self._make_pkg("x=1\n", depth))
180 self._del_pkg(pkg_dir, depth, mod_name)
183 def _check_package(self, depth): argument
185 self._make_pkg("x=1\n", depth, "__main__"))
203 self._del_pkg(pkg_dir, depth, pkg_name)
206 def _add_relative_modules(self, base_dir, source, depth): argument
207 if depth <= 1:
208 raise ValueError("Relative module test needs depth > 1")
211 for i in range(depth):
231 def _check_relative_imports(self, depth, run_name=None): argument
238 self._make_pkg(contents, depth))
240 self._add_relative_modules(pkg_dir, contents, depth)
260 self._del_pkg(pkg_dir, depth, mod_name)
264 for depth in range(4):
265 if verbose: print "Testing package depth:", depth
266 self._check_module(depth)
269 for depth in range(1, 4):
270 if verbose: print "Testing package depth:", depth
271 self._check_package(depth)
298 for depth in range(2, 5):
299 if verbose: print "Testing relative imports at depth:", depth
300 self._check_relative_imports(depth)
303 for depth in range(2, 5):
304 if verbose: print "Testing main relative imports at depth:", depth
305 self._check_relative_imports(depth, "__main__")
420 msg = "recursion depth exceeded"