fix issue492: avoid leak in test_writeorg
This commit is contained in:
parent
8d95f89a6a
commit
0c04b44919
|
@ -40,6 +40,8 @@ NEXT (2.6)
|
||||||
- improvements to pytest's own test-suite leakage detection, courtesy of PRs
|
- improvements to pytest's own test-suite leakage detection, courtesy of PRs
|
||||||
from Marc Abramowitz
|
from Marc Abramowitz
|
||||||
|
|
||||||
|
- fix issue492: avoid leak in test_writeorg
|
||||||
|
|
||||||
2.5.2
|
2.5.2
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -709,13 +709,11 @@ class TestFDCapture:
|
||||||
|
|
||||||
def test_writeorg(self, tmpfile):
|
def test_writeorg(self, tmpfile):
|
||||||
data1, data2 = tobytes("foo"), tobytes("bar")
|
data1, data2 = tobytes("foo"), tobytes("bar")
|
||||||
try:
|
cap = capture.FDCapture(tmpfile.fileno())
|
||||||
cap = capture.FDCapture(tmpfile.fileno())
|
cap.start()
|
||||||
cap.start()
|
tmpfile.write(data1)
|
||||||
tmpfile.write(data1)
|
tmpfile.flush()
|
||||||
cap.writeorg(data2)
|
cap.writeorg(data2)
|
||||||
finally:
|
|
||||||
tmpfile.close()
|
|
||||||
scap = cap.snap()
|
scap = cap.snap()
|
||||||
cap.done()
|
cap.done()
|
||||||
assert scap == totext(data1)
|
assert scap == totext(data1)
|
||||||
|
|
Loading…
Reference in New Issue