sys.path.pop

Here are the examples of the python api sys.path.pop taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

14 Examples 7

Example 1

Project: astroid Source File: unittest_regrtest.py
    def tearDown(self):
        # Since we may have created a brainless manager, leading
        # to a new cache builtin module and proxy classes in the constants,
        # clear out the global manager cache.
        MANAGER.clear_cache(self._builtins)
        MANAGER.always_load_extensions = False
        sys.path.pop(0)
        sys.path_importer_cache.pop(resources.find('data'), None)

Example 2

Project: mythbox Source File: test_modules.py
Function: tear_down
    def tearDown(self):
        # Intentionally using 'assert' here, this is not a test assertion, this
        # is just an "oh cuem what is going ON" assertion. -glyph
        if self.pathSetUp:
            HORK = "path cleanup failed: don't be surprised if other tests break"
            assert sys.path.pop() is self.pathExtensionName, HORK+", 1"
            assert self.pathExtensionName not in sys.path, HORK+", 2"

Example 3

Project: glim Source File: paths.py
def configure():
    if GLIM_ROOT_PATH == PROJECT_PATH:
        print(colored('Development mode is on, sys.path is being configured',
                      'yellow'))
        sys.path.pop(0)
        sys.path.insert(0, GLIM_ROOT_PATH)
    else:
        sys.path.insert(0, PROJECT_PATH)

Example 4

Project: powerline Source File: test_configuration.py
Function: teardown_class
	@classmethod
	def tearDownClass(cls):
		sys.path.pop(0)

Example 5

Project: pymo Source File: test_refactor.py
Function: tear_down
    def tearDown(self):
        sys.path.pop()

Example 6

Project: imagrium Source File: test_pbcvm.py
    def tearDown(self):
        # typical unsafe ops we have to do in testing...
        test_support.verbose = self.old_verbosity
        sys.path.pop(0)
        sys.meta_path.pop(0)

Example 7

Project: robotframework Source File: test_run_and_rebot.py
Function: tear_down
    def tearDown(self):
        chdir(self._orig_path)
        sys.path.pop()

Example 8

Project: mc4p Source File: test_plugins.py
Function: teardown_class
    @classmethod
    def tearDownClass(cls):
        sys.path.pop()
        shutil.rmtree(cls.pdir)

Example 9

Project: Python-mode-klen Source File: lint.py
    def cleanup_import_path(self):
        """Revert any changes made to sys.path in prepare_import_path."""
        sys.path.pop(0)

Example 10

Project: dd-agent Source File: test_rabbitmq.py
Function: teardown_class
    @classmethod
    def tearDownClass(cls):
        sys.path.pop()

Example 11

Project: appier Source File: legacy.py
@contextlib.contextmanager
def ctx_absolute():
    root = sys.path.pop(0)
    try: yield
    finally: sys.path.insert(0, root)

Example 12

Project: coshsh Source File: recipe.py
    def unset_recipe_sys_path(self):
        for p in [p for p in self.classes_path if os.path.exists(p) and os.path.isdir(p)]:
            sys.path.pop(0)

Example 13

Project: spylon Source File: launcher.py
Function: init_spark
    def _init_spark(self):
        """Initializes spark so that pyspark is importable.  This also sets up the required environment variables
        """
        global _SPARK_INITIALIZED
        spark_home = self.spark_home
        python_path = self._python_path

        if use_findspark:
            if _SPARK_INITIALIZED:
                if spark_home == os.environ["SPARK_HOME"]:
                    # matches with already initialized
                    pass
                else:
                    # findspark adds two path to the search path.
                    sys.path.pop(0)
                    sys.path.pop(0)
                    findspark.init(spark_home=spark_home, edit_rc=False, edit_profile=False, python_path=python_path)
            else:
                findspark.init(spark_home=spark_home, edit_rc=False, edit_profile=False, python_path=python_path)

        _SPARK_INITIALIZED = True
        self._set_environment_variables()

Example 14

Project: mamba Source File: example_collector.py
    def _restore_path(self):
        sys.path.pop()