Tianshou/test/pettingzoo/test_pistonball.py
Markus Krimmel ea36dc5195
Changes to support Gym 0.26.0 (#748)
* Changes to support Gym 0.26.0

* Replace map by simpler list comprehension

* Use syntax that is compatible with python 3.7

* Format code

* Fix environment seeding in test environment, fix buffer_profile test

* Remove self.seed() from __init__

* Fix random number generation

* Fix throughput tests

* Fix tests

* Removed done field from Buffer, fixed throughput test, turned off wandb, fixed formatting, fixed type hints, allow preprocessing_fn with truncated and terminated arguments, updated docstrings

* fix lint

* fix

* fix import

* fix

* fix mypy

* pytest --ignore='test/3rd_party'

* Use correct step API in _SetAttrWrapper

* Format

* Fix mypy

* Format

* Fix pydocstyle.
2022-09-26 09:31:23 -07:00

24 lines
511 B
Python

import pprint
import pytest
from pistonball import get_args, train_agent, watch
@pytest.mark.skip(reason="TODO(Markus28): fix later")
def test_piston_ball(args=get_args()):
if args.watch:
watch(args)
return
result, agent = train_agent(args)
# assert result["best_reward"] >= args.win_rate
if __name__ == "__main__":
pprint.pprint(result)
# Let's watch its performance!
watch(args, agent)
if __name__ == "__main__":
test_piston_ball(get_args())