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

Adjust testing methods for optional builds #53

Open
parul-l opened this issue Jan 7, 2020 · 0 comments
Open

Adjust testing methods for optional builds #53

parul-l opened this issue Jan 7, 2020 · 0 comments

Comments

@parul-l
Copy link
Collaborator

parul-l commented Jan 7, 2020

The current implementation creates custom markers on tests, for example:

@pytest.mark.optional
@pytest.mark.postgres
def test_run(monkeypatch):
...

and then calls different pytest commands in the .travis.yml file, for example:

    elif [ $PYPI_BUILD = 'only_plotting' ]; then
        python -m pytest -m "not postgres"

A cleaner way to do this is to use pytest's skipif method:

@pytest.mark.skipif('rpy2' in sys.modules, reason="primrose[R] is optional")
def test_run():
...

This requires just one pytest command, regardless of which build is chosen (postgres, plotting, complete, etc.)

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