2022-09-03 22:56:29 +01:00
|
|
|
from functools import partial
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2022-09-08 10:10:07 +01:00
|
|
|
from gymnasium.spaces import utils
|
2023-02-22 15:05:58 +00:00
|
|
|
from tests.spaces.utils import TESTING_CUSTOM_SPACE
|
2022-09-03 22:56:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"func",
|
|
|
|
[
|
2023-02-22 15:05:58 +00:00
|
|
|
TESTING_CUSTOM_SPACE.sample,
|
|
|
|
partial(TESTING_CUSTOM_SPACE.contains, None),
|
|
|
|
partial(utils.flatdim, TESTING_CUSTOM_SPACE),
|
|
|
|
partial(utils.flatten, TESTING_CUSTOM_SPACE, None),
|
|
|
|
partial(utils.flatten_space, TESTING_CUSTOM_SPACE),
|
|
|
|
partial(utils.unflatten, TESTING_CUSTOM_SPACE, None),
|
2022-09-03 22:56:29 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_not_implemented_errors(func):
|
|
|
|
with pytest.raises(NotImplementedError):
|
|
|
|
func()
|