You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the print function is passed file=sys.stdout (which is listed as the default argument in the python docs). Output capture with capsys and capfd fails. capfd works only if the -s flag is passed to py.test
I came across it testing a logging decorator that had the option to write to a file. I tried every variation of capfd/capsys.disable() as well to no avail. I couldn't find this issue anywhere else, and a quick test on py2.7 shows the same behavior.
The text was updated successfully, but these errors were encountered:
##Environ:
python 3.6, OS X 10.12.2, pytest 3.0.5
##pip list:
When the print function is passed file=sys.stdout (which is listed as the default argument in the python docs). Output capture with
capsys
andcapfd
fails.capfd
works only if the-s
flag is passed to py.test##Example:
I came across it testing a logging decorator that had the option to write to a file. I tried every variation of
capfd
/capsys.disable()
as well to no avail. I couldn't find this issue anywhere else, and a quick test on py2.7 shows the same behavior.The text was updated successfully, but these errors were encountered: