[Pytest-commit] commit/pytest: hpk42: fix issue555: just add "errors" attribute to internal Capture stream.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Aug 7 15:26:21 CEST 2014


1 new commit in pytest:

https://bitbucket.org/hpk42/pytest/commits/737cf55acf3c/
Changeset:   737cf55acf3c
User:        hpk42
Date:        2014-08-07 11:05:42
Summary:     fix issue555: just add "errors" attribute to internal Capture stream.
Affected #:  5 files

diff -r 082460583d9567f5f56ff79e9cefdc2db7824697 -r 737cf55acf3c5401b44f13239fa3d9e87031d8a3 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,9 @@
 - 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 -r 082460583d9567f5f56ff79e9cefdc2db7824697 -r 737cf55acf3c5401b44f13239fa3d9e87031d8a3 _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
 #
-__version__ = '2.6.1.dev2'
+__version__ = '2.6.1.dev3'

diff -r 082460583d9567f5f56ff79e9cefdc2db7824697 -r 737cf55acf3c5401b44f13239fa3d9e87031d8a3 _pytest/capture.py
--- a/_pytest/capture.py
+++ b/_pytest/capture.py
@@ -223,6 +223,7 @@
 
 
 class EncodedFile(object):
+    errors = "strict"  # possibly needed by py3 code (issue555)
     def __init__(self, buffer, encoding):
         self.buffer = buffer
         self.encoding = encoding

diff -r 082460583d9567f5f56ff79e9cefdc2db7824697 -r 737cf55acf3c5401b44f13239fa3d9e87031d8a3 setup.py
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@
         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 -r 082460583d9567f5f56ff79e9cefdc2db7824697 -r 737cf55acf3c5401b44f13239fa3d9e87031d8a3 testing/test_capture.py
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -1012,3 +1012,13 @@
     """)
     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)

Repository URL: https://bitbucket.org/hpk42/pytest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the pytest-commit mailing list