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

PyTest extensions to mark failing tests #13

Open
kmpaul opened this issue Dec 20, 2019 · 1 comment
Open

PyTest extensions to mark failing tests #13

kmpaul opened this issue Dec 20, 2019 · 1 comment

Comments

@kmpaul
Copy link
Owner

kmpaul commented Dec 20, 2019

Some tests fail on different platforms with different versions of MPI (MPICH, OpenMPI, etc.). We should provide a way of labeling these tests so they can be skipped. PyTest provides a @pytest.mark.skipif(...) decorator to tell PyTest to skip tests based on a given condition, and I think we want to figure out how to test for different versions and flavors of MPI.

For example, maybe something like this could be done:

import sys
from mpi4py import MPI

@pytest.mark.skipif(MPI.get_vendor()[0] == 'Open MPI' and
                    MPI.get_vendor()[1] < (4, 0, 1) and
                    sys.platform == 'darwin', reason="Doesn't work with OpenMPI 4.0.0 or lower on Macs")
def test_some_thing():
    ...

In this example would skip the test if the tests were being run on an Apple Mac (darwin) running with OpenMPI version 4.0.0 or lower.

...I think.

@kmpaul
Copy link
Owner Author

kmpaul commented Dec 31, 2019

UPDATE: With PR #15, there no longer appear to be any differences in testing behavior between MPICH and OpenMPI. So, perhaps this feature is now a lower priority.

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

1 participant