diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2017-07-20 22:10:58 -0300 |
---|---|---|
committer | Bruno Oliveira <nicoddemus@gmail.com> | 2017-07-20 22:10:58 -0300 |
commit | abb5d2084192e3d2bc5a68f20d9eb2284cd127cf (patch) | |
tree | 71107b551e026b94218217062984247b2fbc35c9 /_pytest/compat.py | |
parent | 9e3e58af60691f7a8ec4245a7e1e319eb86d4bcd (diff) | |
parent | da12c5234737b7afb2865dc0a2bd99ee138678d3 (diff) | |
download | pytest-abb5d2084192e3d2bc5a68f20d9eb2284cd127cf.tar.gz |
Merge branch 'master' into features
Diffstat (limited to '_pytest/compat.py')
-rw-r--r-- | _pytest/compat.py | 10 |
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 |