We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
update()
1 parent b3b0846 commit b20173aCopy full SHA for b20173a
templateflow/tests/test_multiproc.py
@@ -0,0 +1,26 @@
1
+import os
2
+from concurrent.futures import ProcessPoolExecutor
3
+
4
+import pytest
5
6
+CPUs = os.cpu_count() or 1
7
8
9
+def _update():
10
+ from templateflow.conf import update
11
12
+ update(local=False, overwrite=True, silent=True)
13
+ return True
14
15
+@pytest.mark.skipif(CPUs < 2, reason='At least 2 CPUs are required')
16
+def test_multi_proc_update(tmp_path, monkeypatch):
17
+ tf_home = tmp_path / 'tf_home'
18
+ monkeypatch.setenv('TEMPLATEFLOW_HOME', str(tf_home))
19
20
+ futs = []
21
+ with ProcessPoolExecutor(max_workers=2) as executor:
22
+ for _ in range(2):
23
+ futs.append(executor.submit(_update))
24
25
+ for fut in futs:
26
+ assert fut.result()
0 commit comments