diff --git a/_pytest/doctest.py b/_pytest/doctest.py index d61efebe7..f54f833ec 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -118,7 +118,7 @@ class DoctestItem(pytest.Item): if capman: out, err = capman.suspend_global_capture(in_=True) sys.stdout.write(out) - sys.stdout.write(err) + sys.stderr.write(err) def repr_failure(self, excinfo): import doctest