mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-19 13:32:03 +00:00
Fixed bug in test_shared_memory.py (#1128)
This commit is contained in:
@@ -23,11 +23,13 @@ from tests.spaces.utils import TESTING_SPACES, TESTING_SPACES_IDS
|
||||
)
|
||||
def test_shared_memory_create_read_write(space, num, ctx):
|
||||
"""Test the shared memory functions, create, read and write for all testing spaces."""
|
||||
ctx = mp if ctx is None else mp.get_context(ctx)
|
||||
if ctx not in mp.get_all_start_methods():
|
||||
try:
|
||||
_ctx = mp.get_context(ctx)
|
||||
except ValueError:
|
||||
pytest.skip(
|
||||
f"Multiprocessing start method {ctx} not available on this platform."
|
||||
)
|
||||
ctx = _ctx
|
||||
|
||||
samples = [space.sample() for _ in range(num)]
|
||||
|
||||
|
Reference in New Issue
Block a user