From 9f5349d347bf6970366414d6328e57a89107c8d7 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Tue, 4 Sep 2018 02:30:27 +0300 Subject: [PATCH] Tests: "no_recv" option introduced. --- test/unit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit.py b/test/unit.py index 35c00f97..973a69b7 100644 --- a/test/unit.py +++ b/test/unit.py @@ -250,8 +250,11 @@ class TestUnitHTTP(TestUnit): if '--verbose' in sys.argv: print('>>>', req, sep='\n') - encoding = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding'] - resp = self.recvall(sock).decode(encoding) + resp = '' + + if 'no_recv' not in kwargs: + enc = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding'] + resp = self.recvall(sock).decode(enc) if '--verbose' in sys.argv: print('<<<', resp.encode('utf-8'), sep='\n')