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 | ||||
|   from Marc Abramowitz | ||||
| 
 | ||||
| - fix issue492: avoid leak in test_writeorg | ||||
| 
 | ||||
| 2.5.2 | ||||
| ----------------------------------- | ||||
| 
 | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue