Skip to content

Commit 20eb639

Browse files
committed
remove filelock because we do not use multi-processes in pytest
1 parent 56d4ffc commit 20eb639

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

dl1_data_handler/conftest.py

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from ctapipe.core import run_tool
99
from ctapipe.utils import get_dataset_path
10-
from ctapipe.utils.filelock import FileLock
1110

1211
@pytest.fixture(scope="session")
1312
def prod5_gamma_simtel_path():
@@ -32,19 +31,14 @@ def dl1_gamma_file(dl1_tmp_path, prod5_gamma_simtel_path):
3231

3332
output = dl1_tmp_path / "gamma.dl1.h5"
3433

35-
# prevent running process multiple times in case of parallel tests
36-
with FileLock(output.with_suffix(output.suffix + ".lock")):
37-
if output.is_file():
38-
return output
39-
40-
argv = [
41-
f"--input={prod5_gamma_simtel_path}",
42-
f"--output={output}",
43-
"--write-images",
44-
"--DataWriter.Contact.name=αℓℓ the äüöß",
45-
]
46-
assert run_tool(ProcessorTool(), argv=argv, cwd=dl1_tmp_path) == 0
47-
return output
34+
argv = [
35+
f"--input={prod5_gamma_simtel_path}",
36+
f"--output={output}",
37+
"--write-images",
38+
"--DataWriter.Contact.name=αℓℓ the äüöß",
39+
]
40+
assert run_tool(ProcessorTool(), argv=argv, cwd=dl1_tmp_path) == 0
41+
return output
4842

4943
@pytest.fixture(scope="session")
5044
def r1_gamma_file(r1_tmp_path, prod5_gamma_simtel_path):
@@ -55,16 +49,11 @@ def r1_gamma_file(r1_tmp_path, prod5_gamma_simtel_path):
5549

5650
output = r1_tmp_path / "gamma.r1.h5"
5751

58-
# prevent running process multiple times in case of parallel tests
59-
with FileLock(output.with_suffix(output.suffix + ".lock")):
60-
if output.is_file():
61-
return output
62-
63-
argv = [
64-
f"--input={prod5_gamma_simtel_path}",
65-
f"--output={output}",
66-
f"--DataWriter.write_r1_waveforms=True",
67-
"--DataWriter.Contact.name=αℓℓ the äüöß",
68-
]
69-
assert run_tool(ProcessorTool(), argv=argv, cwd=r1_tmp_path) == 0
70-
return output
52+
argv = [
53+
f"--input={prod5_gamma_simtel_path}",
54+
f"--output={output}",
55+
f"--DataWriter.write_r1_waveforms=True",
56+
"--DataWriter.Contact.name=αℓℓ the äüöß",
57+
]
58+
assert run_tool(ProcessorTool(), argv=argv, cwd=r1_tmp_path) == 0
59+
return output

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ repository = "https://github.com/cta-observatory/dl1-data-handler"
5959
version_file = "dl1_data_handler/_version.py"
6060

6161
[tool.pytest.ini_options]
62-
testpaths = ["dl1_data_handler"]
62+
testpaths = ["dl1_data_handler"]
63+
64+
norecursedirs = [
65+
".git",
66+
"notebooks",
67+
"build",
68+
]

0 commit comments

Comments
 (0)