forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serve] Good error message when Serve not installed and ensure Serve …
…installs ray[default] (ray-project#19570)
- Loading branch information
Showing
5 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Test that Serve gives good error message when no deps are installed. | ||
This tests exist in the ray/tests/ directory instead of ray/serve/tests because | ||
it needs not to have dependencies on serve's conftest.py. | ||
""" | ||
|
||
import os | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.skipif( | ||
os.environ.get("RAY_MINIMAL") != "1", | ||
reason="This test is only run in CI with a minimal Ray installation.") | ||
def test_error_msg(): | ||
with pytest.raises(ModuleNotFoundError, match="install 'ray\[serve\]'"): | ||
from ray import serve | ||
serve.start() | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main(["-v", "-s", __file__]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters