In tests_acq/guide: close temp file before unlinking it.
From the docs:
mkstemp() returns a tuple containing an OS-level handle to an open file (as would be returned by os.open())
Since the file is open, it should be close before unlinking. Otherwise, one gets this error on windows:
fh, fn = tempfile.mkstemp(suffix='.h5')
> os.unlink(fn)
E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process
I know we would not use this on windows most probably, but still...
Interface impacts
Testing
Unit tests
[ ] No unit tests
[ ] Mac
[ ] Linux
[ ] Windows
Independent check of unit tests by [REVIEWER NAME]
[ ] [PLATFORM]:
Functional tests
After this PR, the test do not fail at this point in Windows. They fail later because I test on a VM, and the symbolic links in mica/archive/obspar are not supported in the VM
Description
In tests_acq/guide: close temp file before unlinking it.
From the docs:
Since the file is open, it should be close before unlinking. Otherwise, one gets this error on windows:
I know we would not use this on windows most probably, but still...
Interface impacts
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
After this PR, the test do not fail at this point in Windows. They fail later because I test on a VM, and the symbolic links in
mica/archive/obspar
are not supported in the VM