示例#1
0
 def test_no_env_specified(self):
     script = """
     # conda execute
     """
     msg = 'No environment was found in the .* specification'
     with tmp_script(script) as fname:
         with self.assertRaisesRegexp(RuntimeError, msg):
             execute.execute(fname)
示例#2
0
 def test_no_env_specified(self):
     script = """
     # conda execute
     """
     msg = 'No environment was found in the .* specification'
     with tmp_script(script) as fname:
         with self.assertRaisesRegexp(RuntimeError, msg):
             execute.execute(fname)
示例#3
0
 def test_conda_execute_removes_envs_with_no_exe_log(self):
     script = """
     # conda execute
     # env:
     #  - python >=3
     #  - numpy
     # run_with: python
     """
     with tmp_script(script) as fname:
         fh = open(fname, 'r')
         spec = conda_execute.execute.extract_spec(fh)
         env_spec = spec.get('env', [])
         env_locn = conda_execute.tmpenv.create_env(env_spec)
         # Remove the execution.log file in this environment to test that
         # cleanup_tmp_envs removes the environment when it's called
         exe_log_loc = os.path.join(env_locn, 'conda-meta', 'execution.log')
         if os.path.exists(exe_log_loc):
             os.remove(exe_log_loc)
         conda_execute.tmpenv.cleanup_tmp_envs()
示例#4
0
 def test_conda_execute_removes_envs_with_no_exe_log(self):
     script = """
     # conda execute
     # env:
     #  - python >=3
     #  - numpy
     # run_with: python
     """
     with tmp_script(script) as fname:
         fh = open(fname, "r")
         spec = conda_execute.execute.extract_spec(fh)
         env_spec = spec.get("env", [])
         env_locn = conda_execute.tmpenv.create_env(env_spec)
         # Remove the execution.log file in this environment to test that
         # cleanup_tmp_envs removes the environment when it's called
         exe_log_loc = os.path.join(env_locn, "conda-meta", "execution.log")
         if os.path.exists(exe_log_loc):
             os.remove(exe_log_loc)
         conda_execute.tmpenv.cleanup_tmp_envs()
示例#5
0
 def get_spec(self, script):
     with tmp_script(script) as fname:
         with open(fname, 'r') as fh:
             return execute.extract_spec(fh)
示例#6
0
 def get_spec(self, script):
     with tmp_script(script) as fname:
         with open(fname, 'r') as fh:
             return execute.extract_spec(fh)