Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions testsuite/MDAnalysisTests/coordinates/test_xdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@
import pytest
from unittest.mock import patch

import errno
import numpy as np
import os
from os.path import split
import shutil
import subprocess
from pathlib import Path

import numpy as np
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_allclose)
Expand Down Expand Up @@ -890,6 +888,17 @@ def test_persistent_offsets_readonly(self, tmpdir):
assert_equal(os.path.exists(XDR.offsets_filename(filename,
ending='.lock')), False)

# pre-teardown permission fix - leaving permission blocked dir
# is problematic on py3.9 + Windows it seems. See issue
# [4123](https://github.com/MDAnalysis/mdanalysis/issues/4123)
# for more details.
if os.name == 'nt':
subprocess.call(f"icacls {tmpdir} /grant Users:W", shell=True)
else:
os.chmod(str(tmpdir), 0o777)

shutil.rmtree(tmpdir)

def test_offset_lock_created(self):
assert os.path.exists(XDR.offsets_filename(self.filename,
ending='lock'))
Expand Down