Skip to content

Commit

Permalink
Move parallel tests to separate directory, make sure to initialize ray
Browse files Browse the repository at this point in the history
  • Loading branch information
AnesBenmerzoug committed Mar 21, 2024
1 parent a863d40 commit 58332c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Empty file added tests/parallel/__init__.py
Empty file.
4 changes: 3 additions & 1 deletion tests/utils/conftest.py → tests/parallel/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def parallel_config(request):
yield ParallelConfig(backend="joblib", n_cpus_local=num_workers())
elif request.param == "ray-local":
ray = pytest.importorskip("ray", reason="Ray not installed.")
yield ParallelConfig(backend="ray", n_cpus_local=num_workers())
ray.init(num_cpus=num_workers())
yield ParallelConfig(backend="ray")
ray.shutdown()
elif request.param == "ray-external":
ray = pytest.importorskip("ray", reason="Ray not installed.")
Expand All @@ -22,6 +23,7 @@ def parallel_config(request):
cluster = Cluster(
initialize_head=True, head_node_args={"num_cpus": num_workers()}
)
ray.init(cluster.address)
yield ParallelConfig(backend="ray", address=cluster.address)
ray.shutdown()
cluster.shutdown()
File renamed without changes.

0 comments on commit 58332c0

Please sign in to comment.