From ae035852385032cc6c502c0e560fc682cacdbf34 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 15 Nov 2021 12:13:54 +0000 Subject: Tests: refactored working with processes. --- test/unit/check/go.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/unit/check/go.py') 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 -- cgit