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

make pytest-gmx a local plugin #137

Closed
orbeckst opened this issue Aug 2, 2018 · 1 comment
Closed

make pytest-gmx a local plugin #137

orbeckst opened this issue Aug 2, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@orbeckst
Copy link
Member

orbeckst commented Aug 2, 2018

In PR #102 we are adding the option to restrict mdrun to two threads with the pytest --low-performance option. That uses external code from ianmkenney/pytest-gmx but this code is not pip-installable so this can be inconvenient for users who want to use it.

CHECK: Do the tests run locally without pytest-gmx

Following https://docs.pytest.org/en/latest/writing_plugins.html we can bundle the pytest plugin with our tests. It's only ~10 lines of code https://github.com/ianmkenney/pytest-gmx/blob/master/pytest_gmx.py so this should be easy.

@orbeckst orbeckst added the tests label Aug 2, 2018
@orbeckst orbeckst added this to the 0.7 milestone Aug 2, 2018
@orbeckst orbeckst self-assigned this Aug 2, 2018
@orbeckst
Copy link
Member Author

orbeckst commented Aug 3, 2018

Note: as the pytests docs point out, the conftest.py has to be either in the directory where pytest is run or it has to be in the directory that is tested, e.g.

pytest gromacs/tests

will work with gromacs/tests/conftest.py. This is the chosen setup and we use exactly the above line for Travis CI.

NOTE: When testing locally, use something like

cd GromacsWrapper
pytest --low-performance --disable-warnings --cov=gromacs gromacs/tests

(Under Python 2, pytest-xdist works and one can use -n 4 but under Python 3 it appears to be broken.)

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

No branches or pull requests

1 participant