diff --git a/CHANGELOG b/CHANGELOG index 6d22801c9b4..94f433991ad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,9 @@ NEXT - fix issue437 where assertion rewriting could cause pytest-xdist slaves to collect different tests. Thanks Bruno Oliveira. +- fix issue555: add "errors" attribute to capture-streams to satisfy + some distutils and possibly other code accessing sys.stdout.errors. + - fix issue547 capsys/capfd also work when output capturing ("-s") is disabled. - address issue170: allow pytest.mark.xfail(...) to specify expected exceptions via diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 35cf9d65221..d832fbf12b1 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.6.1.dev2' +__version__ = '2.6.1.dev3' diff --git a/_pytest/capture.py b/_pytest/capture.py index f2445d7b5ba..0b7f615bc12 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -223,6 +223,7 @@ def safe_text_dupfile(f, mode, default_encoding="UTF8"): class EncodedFile(object): + errors = "strict" # possibly needed by py3 code (issue555) def __init__(self, buffer, encoding): self.buffer = buffer self.encoding = encoding diff --git a/setup.py b/setup.py index 1c34bb2c0de..8c0807b21e9 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def main(): name='pytest', description='pytest: simple powerful testing with Python', long_description=long_description, - version='2.6.1.dev2', + version='2.6.1.dev3', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/test_capture.py b/testing/test_capture.py index 591b6761deb..28199fb913b 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1012,3 +1012,13 @@ def test_capturing_and_logging_fundamentals(testdir, method): """) assert "atexit" not in result.stderr.str() + +def test_error_attribute_issue555(testdir): + testdir.makepyfile(""" + import sys + def test_capattr(): + assert sys.stdout.errors == "strict" + assert sys.stderr.errors == "strict" + """) + reprec = testdir.inline_run() + reprec.assertoutcome(passed=1)