diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-11-16 20:37:01 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-11-16 20:37:01 +0300 |
commit | 567f0a7b3049f4532524ac35cb232cbeedb868bf (patch) | |
tree | 8a2eb4f43b5750c6e4fa47d7278a0b2e6e9508ce /test/unit/applications | |
parent | 6d2b60ff3e6f905b81c6d2fc6595b39250e3a586 (diff) | |
download | unit-567f0a7b3049f4532524ac35cb232cbeedb868bf.tar.gz unit-567f0a7b3049f4532524ac35cb232cbeedb868bf.tar.bz2 |
Tests: fixing tests interrupt in terminal.
KeyboardInterrupt re-raised.
Diffstat (limited to 'test/unit/applications')
-rw-r--r-- | test/unit/applications/lang/go.py | 6 | ||||
-rw-r--r-- | test/unit/applications/lang/java.py | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py index 518cd017..866dec47 100644 --- a/test/unit/applications/lang/go.py +++ b/test/unit/applications/lang/go.py @@ -34,10 +34,16 @@ class TestApplicationGo(TestApplicationProto): option.test_dir + '/go/' + script + '/' + name + '.go', ] + if option.detailed: + print("\n$ GOPATH=" + env['GOPATH'] + " " + " ".join(args)) + try: process = subprocess.Popen(args, env=env) process.communicate() + except KeyboardInterrupt: + raise + except: return None diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index e1bd5e0c..0ff85187 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -71,12 +71,18 @@ class TestApplicationJava(TestApplicationProto): ] javac.extend(src) + if option.detailed: + print("\n$ " + " ".join(javac)) + try: process = subprocess.Popen(javac, stderr=subprocess.STDOUT) process.communicate() + except KeyboardInterrupt: + raise + except: - pytest.fail('Cann\'t run javac process.') + pytest.fail('Can\'t run javac process.') def load(self, script, **kwargs): self.prepare_env(script) |