Skip to content

Commit

Permalink
don't fork on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Spaak committed Aug 19, 2021
1 parent 62a39fa commit e721e11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pymc3/tests/test_parallel_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
import multiprocessing
import os
import platform

import aesara
import aesara.tensor as at
Expand Down Expand Up @@ -97,6 +98,11 @@ def test_abort(mp_start_method):

step = pm.CompoundStep([step1, step2])

# on Windows we cannot fork
if platform.system() == "Windows" and mp_start_method == "fork":
raise ValueError(
"this can be ignored but raising error to satisfy xfail; replace with 'return' once test starts passing"
)
if mp_start_method == "spawn":
step_method_pickled = cloudpickle.dumps(step, protocol=-1)
else:
Expand Down Expand Up @@ -135,6 +141,9 @@ def test_explicit_sample(mp_start_method):

step = pm.CompoundStep([step1, step2])

# on Windows we cannot fork
if platform.system() == "Windows" and mp_start_method == "fork":
return
if mp_start_method == "spawn":
step_method_pickled = cloudpickle.dumps(step, protocol=-1)
else:
Expand Down

0 comments on commit e721e11

Please sign in to comment.