summaryrefslogtreecommitdiff
path: root/_pytest
diff options
context:
space:
mode:
authorJordan Guymon <guymonj@amazon.com>2016-08-24 15:44:43 -0700
committerJordan Guymon <guymonj@amazon.com>2016-08-24 16:26:34 -0700
commita152ea2dbbebb3de0f79310159bf060af07ce470 (patch)
treeb9736086c26e90d806e28bea78343608fd166e2f /_pytest
parent3345ac92167fff8b251dc37ad717f79bb95b5b7d (diff)
downloadpytest-a152ea2dbbebb3de0f79310159bf060af07ce470.tar.gz
Add buffer attribute to stdin stub
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/capture.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/_pytest/capture.py b/_pytest/capture.py
index d58c72909..9f60db6ac 100644
--- a/_pytest/capture.py
+++ b/_pytest/capture.py
@@ -455,6 +455,13 @@ class DontReadFromInput:
def close(self):
pass
+ @property
+ def buffer(self):
+ if sys.version_info >= (3,0):
+ return self
+ else:
+ raise AttributeError('redirected stdin has no attribute buffer')
+
def _readline_workaround():
"""