@@ -968,8 +968,7 @@ def test_plot_design_multi_colors(modeler: Modeler, verify_image_cache):
968968
969969
970970@skip_no_xserver
971- @pytest .mark .skip (reason = "Face colors requiring reset of image cache" )
972- def test_plot_design_face_colors (modeler : Modeler , verify_image_cache ):
971+ def test_plot_design_face_colors (modeler : Modeler , tmp_path_factory : pytest .TempPathFactory ):
973972 """Test plotting of design with/without multi_colors."""
974973 design = modeler .create_design ("DesignFaceColors" )
975974 # Create a sketch of a box
@@ -983,13 +982,24 @@ def test_plot_design_face_colors(modeler: Modeler, verify_image_cache):
983982 design .bodies [0 ].faces [1 ].set_color ((0 , 255 , 0 ))
984983 design .bodies [0 ].faces [2 ].set_color ((0 , 0 , 255 ))
985984
985+ # Define file name for screenshot
986+ screenshot_path = (
987+ tmp_path_factory .mktemp ("test_plot_design_face_colors" ) / "plot_design_face_colors.png"
988+ )
989+
990+ # Assert that the file does not exist before plotting
991+ assert not screenshot_path .exists ()
992+
986993 # Design plotting
987994 design .bodies [0 ].plot (
988- screenshot = Path ( IMAGE_RESULTS_DIR , "plot_design_face_colors.png" ) ,
995+ screenshot = screenshot_path ,
989996 merge = False ,
990- multi_colors = True ,
997+ multi_colors = True , # Results are random and thus we cannot compare screenshots easily
991998 )
992999
1000+ # Assert that the file exists after plotting
1001+ assert screenshot_path .exists ()
1002+
9931003
9941004@skip_no_xserver
9951005def test_export_glb (modeler : Modeler ):
0 commit comments