Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test names case (in)sensitivity #93

Open
germa89 opened this issue Oct 2, 2023 · 3 comments
Open

Test names case (in)sensitivity #93

germa89 opened this issue Oct 2, 2023 · 3 comments

Comments

@germa89
Copy link
Contributor

germa89 commented Oct 2, 2023

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
Copy link
Contributor Author

germa89 commented Oct 2, 2023

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

@MatthewFlamm
Copy link
Contributor

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 added a commit to ansys/pymapdl that referenced this issue Oct 2, 2023
* Renaming file and changing thumbnail

* Small fix to doc build

* Activating plots

* Removing duplicated plots.

Removing skip_if_no_xserver

* Increasing time build

* Fixing mesh color bug

* Using pytest-pyvista action for cache. Activating more tests. Improving some

* Changing function name

* Removing unneeded eplot and prints in fixture

* Grouping tests. Cosmetic changes

* Reorg tests.
Plotting some returned plotter objects.
Removing unnecessary plots in fixtures.

* Small fix to test

* Updating image cache

* Updating cache

* Using a higher tolerance in bc legend tests

* Updating image cache

* Adding pytest-pyvista configuration to fixture.

* Updating image cache

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updating cache image

* Update image cache

* Testing adding the files to the PR

* Commenting out assertion

* commenting unused variable

* fixing yaml

* empty commit to trigger cicd

* empty commit to reset the plotting.py file

* Revent changes

* fixing plot bug

* reventing ci.yml file

* reverting to main

* Adding files to PR

* removing 'local' tag from git config

* Fixing link in wsl

* Updating image cache and removing PR part

* Making sure the theme is applied at the beginning.

* Improvement to bug template

* Resetting image cache to main

* recache some tests

* removing dedundant tests

* removing codacy warning

* Removing some start imports

* Adding automatically missing images

* Adding back useful stuff

* Recache some test case senstive

* Adding more fields to test to avoid pytest.pyvista names collision. See pyvista/pytest-pyvista#93

* adding missing image cache

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@germa89
Copy link
Contributor Author

germa89 commented Oct 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants