fix issue492: avoid leak in test_writeorg

This commit is contained in:
holger krekel 2014-04-02 12:32:21 +02:00
parent 8d95f89a6a
commit 0c04b44919
2 changed files with 7 additions and 7 deletions

View File

@ -40,6 +40,8 @@ NEXT (2.6)
- improvements to pytest's own test-suite leakage detection, courtesy of PRs
from Marc Abramowitz
- fix issue492: avoid leak in test_writeorg
2.5.2
-----------------------------------

View File

@ -709,13 +709,11 @@ class TestFDCapture:
def test_writeorg(self, tmpfile):
data1, data2 = tobytes("foo"), tobytes("bar")
try:
cap = capture.FDCapture(tmpfile.fileno())
cap.start()
tmpfile.write(data1)
cap.writeorg(data2)
finally:
tmpfile.close()
cap = capture.FDCapture(tmpfile.fileno())
cap.start()
tmpfile.write(data1)
tmpfile.flush()
cap.writeorg(data2)
scap = cap.snap()
cap.done()
assert scap == totext(data1)