Example #1
0
 def test_os_close(self):
     fname = str(udir.join('os_test.txt'))
     fd = os.open(fname, os.O_WRONLY|os.O_CREAT, 0777)
     assert fd >= 0
     os.write(fd, 'Hello world')
     rposix.close(fd)
     py.test.raises(OSError, rposix.close, fd)
Example #2
0
 def test_os_close(self):
     fname = str(udir.join('os_test.txt'))
     fd = os.open(fname, os.O_WRONLY | os.O_CREAT, 0777)
     assert fd >= 0
     os.write(fd, 'Hello world')
     rposix.close(fd)
     py.test.raises(OSError, rposix.close, fd)