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 Style: test_deprecated.py #1466

Merged
merged 2 commits into from Jul 12, 2017

Conversation

Projects
None yet
5 participants
@utkbansal
Member

utkbansal commented Jul 10, 2017

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@orbeckst orbeckst added the testing label Jul 11, 2017

try:
import MDAnalysis.core.units
except ImportError:
raise AssertionError("MDAnalysis.core.units not available")

This comment has been minimized.

@richardjgowers

richardjgowers Jul 11, 2017

Member

maybe we should use pytest.fail here?

@jbarnoud

This comment has been minimized.

Contributor

jbarnoud commented Jul 11, 2017

Couldn't all of these test move to one parametrized function?

Something in the lines of (from the top of my head, not even typed somewhere I could execute it):

@pytest.mark.parametrize('module', (
    'MDAnalysis.core.units',
    'MDAnalysis.core.util',
    'MDAnalysis.core.log',
    ...)
def test_import(module):
    try:
        importlib.import_module(module)
    except ImportError:
        raise AssertionError("{} not available".format(module))

@jbarnoud jbarnoud referenced this pull request Jul 11, 2017

Merged

Pytest style: test_datafiles.py #1465

0 of 4 tasks complete
@kain88-de

Please address the requested changes from @richardjgowers and @jbarnoud

@kain88-de kain88-de merged commit 4398642 into MDAnalysis:develop Jul 12, 2017

3 checks passed

QuantifiedCode No new issues introduced. 8 issue(s) fixed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 89.674%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment