MCPcopy Index your code
hub / github.com/python/cpython / run_with_capture

Method run_with_capture

Lib/test/test_venv.py:99–103  ·  view source on GitHub ↗
(self, func, *args, **kwargs)

Source from the content-addressed store, hash-verified

97 return os.path.join(env_dir, self.bindir, self.exe)
98
99 def run_with_capture(self, func, *args, **kwargs):
100 with captured_stdout() as output:
101 with captured_stderr() as error:
102 func(*args, **kwargs)
103 return output.getvalue(), error.getvalue()
104
105 def get_env_file(self, *args):
106 return os.path.join(self.env_dir, *args)

Callers 15

test_promptMethod · 0.80
test_prefixesMethod · 0.80
test_sysconfigMethod · 0.80
test_upgradeMethod · 0.80
test_executableMethod · 0.80
test_failed_symlinkMethod · 0.80
test_multiprocessingMethod · 0.80

Calls 4

captured_stdoutFunction · 0.90
captured_stderrFunction · 0.90
funcFunction · 0.70
getvalueMethod · 0.45

Tested by

no test coverage detected