Skip to content

Commit

Permalink
Update test_xdr.py
Browse files Browse the repository at this point in the history
pep
  • Loading branch information
talagayev authored Jan 8, 2025
1 parent 332f8ca commit 73e1d03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions testsuite/MDAnalysisTests/coordinates/test_xdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,18 +1002,18 @@ def test_persistent_offsets_readonly(self, tmpdir):
with pytest.warns(UserWarning, match="Failed to load offsets"):
saved_offsets = XDR.read_numpy_offsets(filename)

# Check if the offsets are handled properly and match reference offsets
# Check if offsets are handled properly and match reference offsets
assert_almost_equal(
saved_offsets, # Compare with reference offsets
saved_offsets, # Compare with reference offsets
ref_offset,
err_msg="error loading frame offsets"
)

assert_equal(os.path.exists(XDR.offsets_filename(filename)), False)
# check the lock file is not created as well.
assert_equal(
os.path.exists(XDR.offsets_filename(filename, ending='.lock')),
False,
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
Expand All @@ -1032,10 +1032,10 @@ def test_offset_lock_created(self):

# Acquire the lock
lock.acquire()
time.sleep(5) # wait 5 seconds before checking if the file is locked
assert lock.is_locked # check if file is locked
time.sleep(5) # wait 5 seconds before checking if the file is locked
assert lock.is_locked # check if file is locked
lock.release()
assert not lock.is_locked # check if file is unlocked
assert not lock.is_locked # check if file is unlocked


class TestXTCReader_offsets(_GromacsReader_offsets):
Expand Down

0 comments on commit 73e1d03

Please sign in to comment.