From ccfb29871c8725012222efd6d1f00182e381af98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphae=CC=88l=20Slinckx?= Date: Fri, 25 Aug 2017 10:37:19 +0200 Subject: [PATCH] tests: Fix send_bytes for testing requests --- tests/treq.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/treq.py b/tests/treq.py index efebd80c..fb714ac3 100644 --- a/tests/treq.py +++ b/tests/treq.py @@ -78,8 +78,11 @@ class request(object): yield lines def send_bytes(self): - for d in str(self.data.decode("latin1")): - yield bytes(d.encode("latin1")) + for d in self.data: + if six.PY3: + yield bytes([d]) + else: + yield d def send_random(self): maxs = round(len(self.data) / 10)