Workaround for random failure of pytest capture on Windows

pytest can capture test output both globally (controlled by the cmd line
flag --capture) or locally (`capsys` and `capfd` fixtures). Enabling both
methods at the same time causes problems on Windows: test output is not
captured sometimes, resulting in test failure. This happens seemingly at
random.

This workaround disables global output capture ("-s", i.e. "--capture=no")
leaving only the local capture fixtures. As a side-effect test output on
AppVeyor CI is a little messy, but this will have to do until a better
solution is found.
This commit is contained in:
Dean Moldovan 2016-08-22 23:09:00 +02:00
parent faec30c4db
commit b6ccdc953d

View File

@ -29,4 +29,5 @@ install:
build_script:
- cmake -A "%CMAKE_ARCH%" -DPYBIND11_WERROR=ON
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- set PYTEST_ADDOPTS="-s" # workaround for pytest capture issue, see #351
- cmake --build . --config Release --target pytest -- /v:m /logger:%MSBuildLogger%