From 54837759f36eddb80af22c8d73e103a948221dc7 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 19 Oct 2020 22:25:29 +0100 Subject: Tests: fixed unit.log print. --- test/unit/http.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'test/unit/http.py') diff --git a/test/unit/http.py b/test/unit/http.py index 7845f9a8..5f073439 100644 --- a/test/unit/http.py +++ b/test/unit/http.py @@ -5,7 +5,6 @@ import os import re import select import socket -import time import pytest from conftest import option @@ -283,23 +282,6 @@ class TestHTTP(TestUnit): def getjson(self, **kwargs): return self.get(json=True, **kwargs) - def waitforsocket(self, port): - ret = False - - for i in range(50): - try: - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.connect(('127.0.0.1', port)) - ret = True - break - except: - sock.close() - time.sleep(0.1) - - sock.close() - - assert ret, 'socket connected' - def form_encode(self, fields): is_multipart = False -- cgit From 567f0a7b3049f4532524ac35cb232cbeedb868bf Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 16 Nov 2020 20:37:01 +0300 Subject: Tests: fixing tests interrupt in terminal. KeyboardInterrupt re-raised. --- test/unit/http.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/unit/http.py') 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: -- cgit