summaryrefslogtreecommitdiff
path: root/tests/testutil.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-27 15:54:54 +0200
committerMichał Górny <mgorny@gentoo.org>2017-10-27 15:54:54 +0200
commit9f5e84d4917b29fe6d7668f4742da8769b4ff515 (patch)
tree0b7796c83f8d3e811e8cf619a5ea219d9ba0224e /tests/testutil.py
parent02d632e75a20c5c2540d4dc703289581f60047f4 (diff)
downloadgemato-9f5e84d4917b29fe6d7668f4742da8769b4ff515.tar.gz
testutil: Fix logger warnings for py2
Diffstat (limited to 'tests/testutil.py')
-rw-r--r--tests/testutil.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/testutil.py b/tests/testutil.py
index e02ea70..89feb3c 100644
--- a/tests/testutil.py
+++ b/tests/testutil.py
@@ -7,13 +7,17 @@ import io
import logging
import os
import os.path
+import sys
import tempfile
import unittest
class LoggingTestCase(unittest.TestCase):
def setUp(self):
- self.log = io.StringIO()
+ if sys.version_info < (3,):
+ self.log = io.BytesIO()
+ else:
+ self.log = io.StringIO()
self.log_handler = logging.getLogger().addHandler(
logging.StreamHandler(self.log))