Skip to content

Commit 31acf21

Browse files
committed
Avoid file locking errors on Windows.
1 parent 3cac249 commit 31acf21

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

tests/Sandpit/Exscientia/_SireWrappers/test_replica_system.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import tempfile
34

45
import pytest
@@ -72,6 +73,9 @@ def test_get_replica(rs, request):
7273
replica_system.getReplica(-11)
7374

7475

76+
@pytest.mark.skipif(
77+
sys.platform == "win32", reason="File locking prevents temp cleanup"
78+
)
7579
@pytest.mark.parametrize("rs", ["replica_system", "perturbable_replica_system"])
7680
def test_stream(rs, request):
7781
"""Test streaming the replica system to a file."""
@@ -134,6 +138,9 @@ def test_save_load_replicas(rs, request):
134138
assert rs.nReplicas() == 5
135139

136140

141+
@pytest.mark.skipif(
142+
sys.platform == "win32", reason="File locking prevents temp cleanup"
143+
)
137144
def test_squashed_representation(squashed_perturbable_replica_system):
138145
"""Test that the internal squashed trajectory representation works."""
139146
# Check that the number of atoms in the internal system is less

tests/_SireWrappers/test_replica_system.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import tempfile
34

45
import pytest
@@ -53,6 +54,9 @@ def test_get_replica(rs, request):
5354
replica_system.getReplica(-11)
5455

5556

57+
@pytest.mark.skipif(
58+
sys.platform == "win32", reason="File locking prevents temp cleanup"
59+
)
5660
@pytest.mark.parametrize("rs", ["replica_system", "perturbable_replica_system"])
5761
def test_stream(rs, request):
5862
"""Test streaming the replica system to a file."""
@@ -115,6 +119,9 @@ def test_save_load_replicas(rs, request):
115119
assert rs.nReplicas() == 5
116120

117121

122+
@pytest.mark.skipif(
123+
sys.platform == "win32", reason="File locking prevents temp cleanup"
124+
)
118125
def test_squashed_representation(squashed_perturbable_replica_system):
119126
"""Test that the internal squashed trajectory representation works."""
120127
# Check that the number of atoms in the internal system is less

0 commit comments

Comments
 (0)