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
3
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)
3
Example 2
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"
3
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)
0
Example 4
@classmethod
def tearDownClass(cls):
sys.path.pop(0)
0
Example 5
def tearDown(self):
sys.path.pop()
0
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)
0
Example 7
def tearDown(self):
chdir(self._orig_path)
sys.path.pop()
0
Example 8
@classmethod
def tearDownClass(cls):
sys.path.pop()
shutil.rmtree(cls.pdir)
0
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)
0
Example 10
@classmethod
def tearDownClass(cls):
sys.path.pop()
0
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)
0
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)
0
Example 13
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()
0
Example 14
Project: mamba Source File: example_collector.py
def _restore_path(self):
sys.path.pop()