pyvista / pytest-pyvista

Plugin to test PyVista plot outputs
https://pytest.pyvista.org
MIT License
13 stars 5 forks source link

Test names case (in)sensitivity #93

Open germa89 opened 12 months ago

germa89 commented 12 months ago

In Pytest you can do:


import pyvista as pv

@pytest.mark.parametrize(
    "title",
    [
        "Mechanical",
        "mechanical",
        "meCHANICAL",
        "ux",
        "UX",
        "CSGZ",
    ],
)
def test_bc_plot_bc_labels(title):

    # Create a simple mesh (a sphere)
    mesh = pv.Sphere()

    # Create a plotter object with a custom title
    plotter = pv.Plotter(title=title)

    # Add the mesh to the plotter
    plotter.add_mesh(mesh)

    # Set up the plotter window and display the plot
    plotter.show()

Pytest won't be able to generate "mechanical" and "meCHANICAL". Nor "UX".

Reference:

germa89 commented 12 months ago

Not sure what the solution is for this. I would feel tempted to add the test number to each image cache.

MatthewFlamm commented 12 months ago

This example runs just fine for me in Linux. I get files like bc_plot_bc_labels[ux] and bc_plot_bc_labels[UX]. Is the problem the case insensitivity in Windows?

germa89 commented 12 months ago

This example runs just fine for me in Linux. I get files like bc_plot_bc_labels[ux] and bc_plot_bc_labels[UX]. Is the problem the case insensitivity in Windows?

Yes.