summaryrefslogtreecommitdiff
path: root/_pytest/compat.py
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2017-07-20 22:10:58 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2017-07-20 22:10:58 -0300
commitabb5d2084192e3d2bc5a68f20d9eb2284cd127cf (patch)
tree71107b551e026b94218217062984247b2fbc35c9 /_pytest/compat.py
parent9e3e58af60691f7a8ec4245a7e1e319eb86d4bcd (diff)
parentda12c5234737b7afb2865dc0a2bd99ee138678d3 (diff)
downloadpytest-abb5d2084192e3d2bc5a68f20d9eb2284cd127cf.tar.gz
Merge branch 'master' into features
Diffstat (limited to '_pytest/compat.py')
-rw-r--r--_pytest/compat.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/_pytest/compat.py b/_pytest/compat.py
index 9cebbb974..45f9f86d4 100644
--- a/_pytest/compat.py
+++ b/_pytest/compat.py
@@ -282,7 +282,15 @@ def _setup_collect_fakemodule():
if _PY2:
- from py.io import TextIO as CaptureIO
+ # Without this the test_dupfile_on_textio will fail, otherwise CaptureIO could directly inherit from StringIO.
+ from py.io import TextIO
+
+ class CaptureIO(TextIO):
+
+ @property
+ def encoding(self):
+ return getattr(self, '_encoding', 'UTF-8')
+
else:
import io