summaryrefslogtreecommitdiffhomepage
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/applications/lang/go.py6
-rw-r--r--test/unit/applications/lang/java.py8
-rw-r--r--test/unit/check/go.py3
-rw-r--r--test/unit/http.py10
4 files changed, 24 insertions, 3 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)
diff --git a/test/unit/check/go.py b/test/unit/check/go.py
index dd2150eb..35b0c2d5 100644
--- a/test/unit/check/go.py
+++ b/test/unit/check/go.py
@@ -25,5 +25,8 @@ def check_go(current_dir, temp_dir, test_dir):
if process.returncode == 0:
return True
+ except KeyboardInterrupt:
+ raise
+
except:
return None
diff --git a/test/unit/http.py b/test/unit/http.py
index 5f073439..8d964978 100644
--- a/test/unit/http.py
+++ b/test/unit/http.py
@@ -187,6 +187,10 @@ class TestHTTP(TestUnit):
try:
part = sock.recv(buff_size)
+
+ except KeyboardInterrupt:
+ raise
+
except:
break
@@ -242,7 +246,8 @@ class TestHTTP(TestUnit):
try:
last_size = int(chunks[-2], 16)
- except:
+
+ except ValueError:
pytest.fail('Invalid zero size chunk')
if last_size != 0 or chunks[-1] != b'':
@@ -252,7 +257,8 @@ class TestHTTP(TestUnit):
while len(chunks) >= 2:
try:
size = int(chunks.pop(0), 16)
- except:
+
+ except ValueError:
pytest.fail('Invalid chunk size %s' % str(size))
if size == 0: