File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+
13import jax
24import jax .numpy as jnp
35import numpy as np
@@ -28,6 +30,11 @@ def skip_unavailable_device(device: str):
2830 pytest .skip (f"{ device } device not available" )
2931
3032
33+ def skip_headless ():
34+ if os .environ .get ("DISPLAY" ) is None :
35+ pytest .skip ("DISPLAY is not set, skipping test in headless environment" )
36+
37+
3138def array_meta_assert (
3239 x : Array ,
3340 shape : tuple [int , ...] | None = None ,
@@ -270,6 +277,7 @@ def test_render_human(device: str):
270277@pytest .mark .parametrize ("device" , ["gpu" , "cpu" ])
271278def test_render_rgb_array (device : str ):
272279 skip_unavailable_device (device )
280+ skip_headless ()
273281 sim = Sim (n_worlds = 2 , device = device )
274282 img = sim .render (mode = "rgb_array" , width = 1024 , height = 1024 )
275283 assert isinstance (img , np .ndarray ), "Image must be a numpy array"
You can’t perform that action at this time.
0 commit comments