MCPcopy Create free account
hub / github.com/catchorg/Catch2 / run_common

Function run_common

tests/TestScripts/testBazelExitGuardFile.py:18–36  ·  view source on GitHub ↗
(cmd, env = None)

Source from the content-addressed store, hash-verified

16
17
18def run_common(cmd, env = None):
19 cmd_env = env if env is not None else os.environ.copy()
20 print('Running:', cmd)
21
22 try:
23 ret = subprocess.run(
24 cmd,
25 stdout=subprocess.PIPE,
26 stderr=subprocess.PIPE,
27 check=True,
28 universal_newlines=True,
29 env=cmd_env
30 )
31 except subprocess.SubprocessError as ex:
32 print('Could not run "{}"'.format(cmd))
33 print("Return code: {}".format(ex.returncode))
34 print("stdout: {}".format(ex.stdout))
35 print("stderr: {}".format(ex.stderr))
36 raise
37
38
39def test_bazel_env_vars(bin_path, guard_path):

Callers 3

test_bazel_env_varsFunction · 0.85
test_cli_parameterFunction · 0.85
test_no_crashFunction · 0.85

Calls 2

printFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected