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.
Remove rllib dependency from core tests (ray-project#51171)
More work towards breaking the core -> libraries dependencies. - `test_output.py`: changed to use ray core API instead. - `test_client_library_integration.py`: moved to a test inside rllib directory. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
- Loading branch information
Showing
5 changed files
with
47 additions
and
94 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 was deleted.
Oops, something went wrong.
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,27 @@ | ||
import sys | ||
|
||
import pytest | ||
|
||
from ray.rllib.algorithms import dqn | ||
from ray.util.client.ray_client_helpers import ray_start_client_server | ||
from ray._private.client_mode_hook import enable_client_mode, client_mode_should_convert | ||
|
||
|
||
def test_basic_dqn(): | ||
with ray_start_client_server(): | ||
# Need to enable this for client APIs to be used. | ||
with enable_client_mode(): | ||
# Confirming mode hook is enabled. | ||
assert client_mode_should_convert() | ||
config = ( | ||
dqn.DQNConfig() | ||
.environment("CartPole-v1") | ||
.env_runners(num_env_runners=0, compress_observations=True) | ||
) | ||
trainer = config.build() | ||
for i in range(2): | ||
trainer.train() | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(pytest.main(["-v", "-s", __file__])) |