local merge of #1967 - Change exception raised by capture.DontReadFromInput.fileno()

This commit is contained in:
Ronny Pfannschmidt 2016-10-24 12:47:55 +02:00
commit 377e649e61
3 changed files with 7 additions and 1 deletions

View File

@ -131,5 +131,6 @@ Tom Viner
Trevor Bekolay
Tyler Goodlet
Vasily Kuznetsov
Vlad Dragos
Wouter van Ackooy
Xuecong Liao

View File

@ -24,6 +24,8 @@ Changes
* ``--pdbcls`` no longer implies ``--pdb``. This makes it possible to use
``addopts=--pdbcls=module.SomeClass`` on ``pytest.ini``. Thanks `@davidszotten`_ for
the PR (`#1952`_).
* Change exception raised by ``capture.DontReadFromInput.fileno()`` from ``ValueError``
to ``io.UnsupportedOperation``. Thanks `@vlad-dragos`_ for the PR.
.. _@davidszotten: https://github.com/davidszotten
@ -92,6 +94,7 @@ Changes
.. _@raquel-ucl: https://github.com/raquel-ucl
.. _@axil: https://github.com/axil
.. _@tgoodlet: https://github.com/tgoodlet
.. _@vlad-dragos: https://github.com/vlad-dragos
.. _#1853: https://github.com/pytest-dev/pytest/issues/1853
.. _#1905: https://github.com/pytest-dev/pytest/issues/1905

View File

@ -7,6 +7,7 @@ from __future__ import with_statement
import contextlib
import sys
import os
from io import UnsupportedOperation
from tempfile import TemporaryFile
import py
@ -447,7 +448,8 @@ class DontReadFromInput:
__iter__ = read
def fileno(self):
raise ValueError("redirected Stdin is pseudofile, has no fileno()")
raise UnsupportedOperation("redirected stdin is pseudofile, "
"has no fileno()")
def isatty(self):
return False