Lines Matching refs:mod_name
160 mod_name = "<Nonsense>"
164 mod_spec = importlib.machinery.ModuleSpec(mod_name,
169 "__name__": mod_name,
181 mod_name,
189 def expect_import_error(self, mod_name): argument
191 run_module(mod_name)
195 self.fail("Expected import error for " + mod_name)
247 mod_name = (pkg_name+".")*depth + mod_base
248 mod_spec = importlib.util.spec_from_file_location(mod_name,
250 return pkg_dir, mod_fname, mod_name, mod_spec
291 pkg_dir, mod_fname, mod_name, mod_spec = (
295 forget(mod_name)
298 "__name__": mod_name,
301 "__package__": mod_name.rpartition(".")[0],
311 return run_module(mod_name, init_globals, alter_sys=alter_sys)
313 if verbose > 1: print("Running from source:", mod_name)
316 __import__(mod_name)
320 unload(mod_name) # In case loader caches paths
322 if verbose > 1: print("Running from compiled:", mod_name)
331 pkg_dir, mod_fname, mod_name, mod_spec = (
335 pkg_name = mod_name.rpartition(".")[0]
336 forget(mod_name)
339 "__name__": mod_name,
357 __import__(mod_name)
361 unload(mod_name) # In case loader caches paths
399 pkg_dir, mod_fname, mod_name, mod_spec = (
402 expected_name = mod_name
407 pkg_name = mod_name.rpartition('.')[0]
408 if verbose > 1: print("Running from source:", mod_name)
409 d1 = run_module(mod_name, run_name=run_name) # Read from source
416 __import__(mod_name)
420 unload(mod_name) # In case the loader caches paths
421 if verbose > 1: print("Running from compiled:", mod_name)
423 d2 = run_module(mod_name, run_name=run_name) # Read from bytecode
451 pkg_dir, _, mod_name, _ = result
452 mod_name = mod_name.replace(".__main__", "")
464 run_module(mod_name)
470 run_module(mod_name + ".submodule")
477 pkg_dir, _, mod_name, _ = self._make_pkg("", 1)
479 __import__(mod_name)
482 run_module(mod_name)
487 pkg_dir, _, mod_name, _ = self._make_pkg("", 1, "__main__")
489 package = mod_name.replace(".__main__", "")
497 __import__(mod_name)
539 pkg_dir, mod_fname, mod_name, mod_spec = (
541 forget(mod_name)
547 "__package__": mod_name.rpartition(".")[0],
551 return run_module(mod_name, init_globals, run_name)
577 pkg_dir, mod_fname, mod_name, mod_spec = (
604 expected_argv0, mod_name=None, argument
610 if mod_name is None:
613 spec_name = mod_name
638 if expect_spec and mod_name is None:
654 mod_name = 'script'
655 script_name = self._make_test_script(script_dir, mod_name)
661 mod_name = 'script'
663 mod_name))
669 mod_name = 'script'
670 script_name = self._make_test_script(script_dir, mod_name,
677 mod_name = 'script'
678 script_name = self._make_test_script(script_dir, mod_name)
686 mod_name = '__main__'
687 script_name = self._make_test_script(script_dir, mod_name)
689 script_dir, mod_name=mod_name)
693 mod_name = '__main__'
694 script_name = self._make_test_script(script_dir, mod_name)
700 script_dir, mod_name=mod_name)
704 mod_name = 'not_main'
705 script_name = self._make_test_script(script_dir, mod_name)
711 mod_name = '__main__'
712 script_name = self._make_test_script(script_dir, mod_name)
715 mod_name=mod_name, check_loader=False)
719 mod_name = '__main__'
720 script_name = self._make_test_script(script_dir, mod_name)
725 mod_name=mod_name, check_loader=False)
729 mod_name = 'not_main'
730 script_name = self._make_test_script(script_dir, mod_name)
738 mod_name = '__main__'
741 script_name = self._make_test_script(script_dir, mod_name, source)