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.

45 Examples 7

Example 1

Project: astroid
Source File: unittest_regrtest.py
View license
    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
View license
    def tearDown(self):
        # Intentionally using 'assert' here, this is not a test assertion, this
        # is just an "oh fuck 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: mythbox
Source File: test_modules.py
View license
    def tearDown(self):
        # Intentionally using 'assert' here, this is not a test assertion, this
        # is just an "oh fuck 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 4

Project: glim
Source File: paths.py
View license
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 5

Project: glim
Source File: paths.py
View license
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 6

View license
    def tearDown(self):
        # Intentionally using 'assert' here, this is not a test assertion, this
        # is just an "oh fuck 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 7

View license
    def tearDown(self):
        # Intentionally using 'assert' here, this is not a test assertion, this
        # is just an "oh fuck 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 8

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

Example 9

View license
	@classmethod
	def tearDownClass(cls):
		sys.path.pop(0)

Example 10

Project: powerline
Source File: test_selectors.py
View license
	@classmethod
	def tearDownClass(cls):
		sys.path.pop(0)

Example 11

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

Example 12

Project: imagrium
Source File: test_pbcvm.py
View license
    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 13

View license
    def tearDown(self):
        chdir(self._orig_path)
        sys.path.pop()

Example 14

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

Example 15

Project: WAPT
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 16

Project: TrustRouter
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 17

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

Example 18

Project: PythonScript
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 19

Project: chipsec
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 20

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

Example 21

Project: datafari
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 22

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

Example 23

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

Example 24

Project: openwrt-mt7620
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 25

Project: openwrt-mt7620
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 26

Project: ironpython3
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 27

Project: kbengine
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 28

Project: kbengine
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 29

Project: coshsh
Source File: recipe.py
View license
    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 30

Project: py3kwarn
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 31

Project: py3kwarn
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 32

Project: spylon
Source File: launcher.py
View license
    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 33

Project: spylon
Source File: launcher.py
View license
    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 34

Project: mc3p
Source File: test_plugins.py
View license
    @classmethod
    def tearDownClass(cls):
        sys.path.pop()
        shutil.rmtree(cls.pdir)

Example 35

Project: mc3p
Source File: test_plugins.py
View license
    @classmethod
    def tearDownClass(cls):
        sys.path.pop()
        shutil.rmtree(cls.pdir)

Example 36

Project: iot-utilities
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 37

Project: iot-utilities
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 38

Project: iot-utilities
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 39

Project: iot-utilities
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()

Example 40

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

Example 41

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

Example 42

Project: neuroConstruct
Source File: test_pbcvm.py
View license
    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 43

Project: neuroConstruct
Source File: test_pbcvm.py
View license
    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 44

Project: medicare-demo
Source File: test_pbcvm.py
View license
    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 45

Project: PyAutoC
Source File: test_refactor.py
View license
    def tearDown(self):
        sys.path.pop()