Skip to content

Commit 5f1864d

Browse files
committed
fixup! re-use tmpfile for devnull
1 parent 9662f82 commit 5f1864d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/_pytest/capture.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ def __init__(self, targetfd, tmpfile=None, capman: Optional[CaptureManager] = No
579579
assert not tmpfile.closed
580580
except KeyError:
581581
tmpfile = open(os.devnull, "r")
582+
capman._tmpfiles[targetfd] = tmpfile
582583
else:
583584
tmpfile = open(os.devnull, "r")
584585
self.syscapture = SysCapture(targetfd)

0 commit comments

Comments
 (0)