Skip to content

Commit a30d41b

Browse files
committed
skip multiprocessing tests on osx
1 parent 88ca4dc commit a30d41b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_autopopulate.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import platform
2+
13
import pymysql
24
import pytest
35

@@ -63,7 +65,9 @@ def test_populate_key_list(clean_autopopulate, subject, experiment, trial):
6365
assert n == ret["success_count"]
6466

6567

66-
def test_populate_exclude_error_and_ignore_jobs(clean_autopopulate, schema_any, subject, experiment):
68+
def test_populate_exclude_error_and_ignore_jobs(
69+
clean_autopopulate, schema_any, subject, experiment
70+
):
6771
# test simple populate
6872
assert subject, "root tables are empty"
6973
assert not experiment, "table already filled?"
@@ -87,11 +91,15 @@ def test_allow_direct_insert(clean_autopopulate, subject, experiment):
8791
experiment.insert1(key, allow_direct_insert=True)
8892

8993

94+
@pytest.mark.skipif(
95+
platform.system() == "Darwin",
96+
reason="multiprocessing with spawn method (macOS default) cannot pickle thread locks",
97+
)
9098
@pytest.mark.parametrize("processes", [None, 2])
9199
def test_multi_processing(clean_autopopulate, subject, experiment, processes):
92100
assert subject, "root tables are empty"
93101
assert not experiment, "table already filled?"
94-
experiment.populate(processes=None)
102+
experiment.populate(processes=processes)
95103
assert len(experiment) == len(subject) * experiment.fake_experiments_per_subject
96104

97105

0 commit comments

Comments
 (0)