MCPcopy Create free account
hub / github.com/microsoft/debugpy / _make_env

Method _make_env

tests/debug/session.py:351–382  ·  view source on GitHub ↗
(self, base_env, codecov=True)

Source from the content-addressed store, hash-verified

349 return True
350
351 def _make_env(self, base_env, codecov=True):
352 env = util.Env.snapshot()
353
354 if base_env is not None:
355 base_env = dict(base_env)
356 python_path = base_env.pop("PYTHONPATH", None)
357 if python_path is not None:
358 env.prepend_to("PYTHONPATH", python_path)
359 env.update(base_env)
360
361 env["PYTHONUNBUFFERED"] = "1"
362 env["PYTHONWARNINGS"] = "error"
363 env["DEBUGPY_TEST_SESSION_ID"] = str(self.id)
364 env.prepend_to("PYTHONPATH", DEBUGGEE_PYTHONPATH.strpath)
365
366 if self._init_log_dir():
367 env.update(
368 {
369 "DEBUGPY_LOG_DIR": self.log_dir.strpath,
370 "PYDEVD_DEBUG": "True",
371 "PYDEVD_DEBUG_FILE": (self.log_dir / "pydevd.log").strpath,
372 }
373 )
374
375 if self.backchannel is not None:
376 env["DEBUGPY_TEST_BACKCHANNEL_PORT"] = str(self.backchannel.port)
377
378 if not codecov:
379 # Disable codecov subprocess hook for that process.
380 env.pop("COV_CORE_SOURCE", None)
381
382 return env
383
384 def _make_python_cmdline(self, exe, *args):
385 def normalize(s, strip_quotes=False):

Callers 2

spawn_debuggeeMethod · 0.95
spawn_adapterMethod · 0.95

Calls 5

_init_log_dirMethod · 0.95
snapshotMethod · 0.80
popMethod · 0.80
prepend_toMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected