Skip to content

Commit d9bca02

Browse files
committed
fix: issue with distributing tests with pytest -n auto
2 parents 233a076 + 942a68d commit d9bca02

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

pydra/engine/run_pickled_function.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
import pydra
33
import sys
44

5+
56
def run_pickled():
67
file_path = sys.argv[1]
78
with open(file_path, 'rb') as file:
89
loaded_function = pickle.load(file)
910

1011
result = loaded_function(rerun=False)
11-
12-
print(f'Result: {result}')
1312

14-
if __name__ == '__main__':
13+
print(f"Result: {result}")
14+
15+
16+
if __name__ == "__main__":
1517
run_pickled()

pydra/engine/run_pickled_function_2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pydra
33
import sys
44

5+
56
def run_pickled():
67
file_path_1 = sys.argv[1]
78
file_path_2 = sys.argv[2]
@@ -15,7 +16,8 @@ def run_pickled():
1516

1617
result = loaded_function(taskmain, ind, rerun=False)
1718

18-
print(f'Result: {result}')
19+
print(f"Result: {result}")
20+
1921

20-
if __name__ == '__main__':
22+
if __name__ == "__main__":
2123
run_pickled()

pydra/engine/workers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ def make_spec(self, cmd=None, arg=None):
910910
spec = self.psij.JobSpec()
911911
spec.executable = cmd
912912
spec.arguments = arg
913-
spec.stdout_path = '/pydra/pydra/engine/demo.stdout'
914-
spec.stderr_path = '/pydra/pydra/engine/demo.stderr'
913+
spec.stdout_path = "/pydra/pydra/engine/demo.stdout"
914+
spec.stderr_path = "/pydra/pydra/engine/demo.stderr"
915915

916916
return spec
917917

@@ -950,13 +950,14 @@ async def exec_psij(self, runnable, rerun=False):
950950
job = self.make_job(spec, None)
951951
jex.submit(job)
952952
job.wait()
953-
953+
954954
return
955955

956956
def close(self):
957957
"""Finalize the internal pool of tasks."""
958958
pass
959959

960+
960961
WORKERS = {
961962
"serial": SerialWorker,
962963
"cf": ConcurrentFuturesWorker,

0 commit comments

Comments
 (0)