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

Merged
merged 2 commits into from
Jul 12, 2017
Merged

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should use pytest.fail here?

@jbarnoud
Copy link
Contributor

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 mentioned this pull request Jul 11, 2017
4 tasks
Copy link
Member

@kain88-de kain88-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the requested changes from @richardjgowers and @jbarnoud

@kain88-de kain88-de merged commit 4398642 into MDAnalysis:develop Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants