示例#1
0
def test_env_exit():
    """
    Test an environment that straightup exits.
    """
    try:
        AsyncGymEnv(lambda: sys.exit(1), None)
    except RuntimeError:
        return
    pytest.fail('should have gotten exception')
示例#2
0
def test_env_exception():
    """
    Test an environment that throws.
    """
    try:
        def raiser():
            raise ValueError('hello world')
        AsyncGymEnv(raiser, None)
    except RuntimeError:
        return
    pytest.fail('should have gotten exception')
示例#3
0
    def test_exception(self):
        """
        Test an environment that throws.
        """
        try:

            def raiser():  # pylint: disable=C0111
                raise ValueError('hello world')

            AsyncGymEnv(raiser, None)
        except RuntimeError:
            return
        self.fail('should have gotten exception')