Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/2266.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert skipped test for test_plot_design_face_colors
18 changes: 14 additions & 4 deletions tests/integration/test_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,7 @@ def test_plot_design_multi_colors(modeler: Modeler, verify_image_cache):


@skip_no_xserver
@pytest.mark.skip(reason="Face colors requiring reset of image cache")
def test_plot_design_face_colors(modeler: Modeler, verify_image_cache):
def test_plot_design_face_colors(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory):
"""Test plotting of design with/without multi_colors."""
design = modeler.create_design("DesignFaceColors")
# Create a sketch of a box
Expand All @@ -983,13 +982,24 @@ def test_plot_design_face_colors(modeler: Modeler, verify_image_cache):
design.bodies[0].faces[1].set_color((0, 255, 0))
design.bodies[0].faces[2].set_color((0, 0, 255))

# Define file name for screenshot
screenshot_path = (
tmp_path_factory.mktemp("test_plot_design_face_colors") / "plot_design_face_colors.png"
)

# Assert that the file does not exist before plotting
assert not screenshot_path.exists()

# Design plotting
design.bodies[0].plot(
screenshot=Path(IMAGE_RESULTS_DIR, "plot_design_face_colors.png"),
screenshot=screenshot_path,
merge=False,
multi_colors=True,
multi_colors=True, # Results are random and thus we cannot compare screenshots easily
)

# Assert that the file exists after plotting
assert screenshot_path.exists()


@skip_no_xserver
def test_export_glb(modeler: Modeler):
Expand Down
Loading