-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Description
Fixtures that use capfd don't seem to work in version 3.3.1 running on Ubuntu 14.04 LTS with anaconda 3.6.3
import sys
@pytest.fixture()
def fix(capfd):
yield None
out, err = capfd.readouterr()
stdout_filename = "/tmp/stdout"
stderr_filename = "/tmp/stderr"
mode = 'w'
with open(stdout_filename, mode) as stdout:
stdout.write(out)
with open(stderr_filename, mode) as stderr:
stderr.write(err)
def test_a(fix):
print("lolcatz")
print("this is a test")
sys.stderr.write("err")
The stdout and stderr files end up empty after running that test. Using this set of pytest dependencies
certifi (2017.11.5)
pip (9.0.1)
pluggy (0.6.0)
py (1.5.2)
pytest (3.3.1)
setuptools (38.2.4)
six (1.11.0)
wheel (0.30.0)
Steps of replication are
- Create the above test
- Run pytest on it.
- cat /tmp/std* (they will be empty)
- Downgrade pytest ( pip install autohil==3.2.5 )
- Run the test again
- cat /tmp/std*
Metadata
Metadata
Assignees
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously