1+ import platform
2+
13import pymysql
24import 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 ])
9199def 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