# Ensure that we don't instantiate portage.settings, so that tests should # work the same regardless of global configuration file state/existence. portage._disable_legacy_globals() from portage.util._eventloop.global_event_loop import global_event_loop if os.environ.get('NOCOLOR') in ('yes', 'true'): portage.output.nocolor() import repoman.tests as tests from portage.const import PORTAGE_BIN_PATH path = os.environ.get("PATH", "").split(":") path = [x for x in path if x] insert_bin_path = True try: insert_bin_path = not path or \ not os.path.samefile(path[0], PORTAGE_BIN_PATH) except OSError: pass if insert_bin_path: path.insert(0, PORTAGE_BIN_PATH) os.environ["PATH"] = ":".join(path) if __name__ == "__main__": try: sys.exit(tests.main()) finally: global_event_loop().close()
# import our centrally initialized portage instance from repoman._portage import portage portage._internal_caller = True # Ensure that we don't instantiate portage.settings, so that tests should # work the same regardless of global configuration file state/existence. portage._disable_legacy_globals() if os.environ.get('NOCOLOR') in ('yes', 'true'): portage.output.nocolor() import repoman.tests as tests from portage.const import PORTAGE_BIN_PATH path = os.environ.get("PATH", "").split(":") path = [x for x in path if x] insert_bin_path = True try: insert_bin_path = not path or \ not os.path.samefile(path[0], PORTAGE_BIN_PATH) except OSError: pass if insert_bin_path: path.insert(0, PORTAGE_BIN_PATH) os.environ["PATH"] = ":".join(path) if __name__ == "__main__": sys.exit(tests.main())