summaryrefslogtreecommitdiffhomepage
path: root/test/unit/check/go.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2021-11-15 12:13:54 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2021-11-15 12:13:54 +0000
commitae035852385032cc6c502c0e560fc682cacdbf34 (patch)
tree1f2ce0debba13e7cf2589a432638c65c38bc607d /test/unit/check/go.py
parent28eaf9d37842a5d79d8081cc14fbf4cc7e7d49a5 (diff)
downloadunit-ae035852385032cc6c502c0e560fc682cacdbf34.tar.gz
unit-ae035852385032cc6c502c0e560fc682cacdbf34.tar.bz2
Tests: refactored working with processes.
Diffstat (limited to 'test/unit/check/go.py')
-rw-r--r--test/unit/check/go.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/unit/check/go.py b/test/unit/check/go.py
index 309091c0..cc17f0fe 100644
--- a/test/unit/check/go.py
+++ b/test/unit/check/go.py
@@ -11,7 +11,7 @@ def check_go(current_dir, temp_dir, test_dir):
env['GO111MODULE'] = 'auto'
try:
- process = subprocess.Popen(
+ process = subprocess.run(
[
'go',
'build',
@@ -20,8 +20,9 @@ def check_go(current_dir, temp_dir, test_dir):
test_dir + '/go/empty/app.go',
],
env=env,
+ stderr=subprocess.STDOUT,
+ stdout=subprocess.PIPE,
)
- process.communicate()
if process.returncode == 0:
return True
@@ -29,5 +30,5 @@ def check_go(current_dir, temp_dir, test_dir):
except KeyboardInterrupt:
raise
- except:
+ except subprocess.CalledProcessError:
return None