conftest.py 451 B

1234567891011121314151617
  1. import os
  2. import pytest
  3. import ray
  4. TEST_NAMESPACE = "ray_dag_test_namespace"
  5. @pytest.fixture(scope="session")
  6. def shared_ray_instance():
  7. # Remove ray address for test ray cluster in case we have
  8. # lingering RAY_ADDRESS="http://127.0.0.1:8265" from previous local job
  9. # submissions.
  10. if "RAY_ADDRESS" in os.environ:
  11. del os.environ["RAY_ADDRESS"]
  12. yield ray.init(num_cpus=16, namespace=TEST_NAMESPACE, log_to_driver=True)