Browse Source

[FIX] fix bugs in test_hetero

tags/v0.3.2
Gene 2 years ago
parent
commit
13bb47359d
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      tests/test_hetero_market/test_hetero.py

+ 3
- 2
tests/test_hetero_market/test_hetero.py View File

@@ -5,10 +5,10 @@ import copy
import joblib
import zipfile
import numpy as np
import multiprocessing
from sklearn.linear_model import Ridge
from sklearn.datasets import make_regression
from shutil import copyfile, rmtree
from multiprocessing import Pool
from learnware.client import LearnwareClient
from sklearn.metrics import mean_squared_error

@@ -121,7 +121,8 @@ class TestMarket(unittest.TestCase):
dir_path = os.path.join(curr_root, "learnware_pool")

# Execute multi-process checking using Pool
with Pool() as pool:
mp_context = multiprocessing.get_context("spawn")
with mp_context.Pool() as pool:
results = pool.starmap(check_learnware, [(name, dir_path) for name in os.listdir(dir_path)])

# Use an assert statement to ensure that all checks return True


Loading…
Cancel
Save