python-lxml/close_file_before_test.patch

16 lines
593 B
Diff
Raw Normal View History

---
src/lxml/tests/test_etree.py | 2 ++
1 file changed, 2 insertions(+)
--- a/src/lxml/tests/test_etree.py
+++ b/src/lxml/tests/test_etree.py
@@ -5278,6 +5278,8 @@ class ETreeWriteTestCase(HelperTestCase)
tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>'))
with tmpfile() as filename:
tree.write(filename, compression=9)
+ os.fsync(filename[0])
+ os.lseek(filename[0], 0, os.SEEK_SET)
data = etree.tostring(etree.parse(filename))
self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'),
data)