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 analysis/test_nuclinfo.py #1549

Merged
merged 3 commits into from Jul 26, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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


@staticmethod
@pytest.fixture()
def u():
Copy link
Member

Choose a reason for hiding this comment

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

can we increase the scope of this fixture?

Copy link
Member Author

Choose a reason for hiding this comment

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

@richardjgowers Increase to what level?

@richardjgowers richardjgowers self-assigned this Jul 25, 2017
@utkbansal
Copy link
Member Author

@richardjgowers Done. Dropped the class too.

@utkbansal utkbansal changed the title [WIP]Pytest Style analysis/test_nuclinfo.py Pytest Style analysis/test_nuclinfo.py Jul 25, 2017
Copy link
Member

@richardjgowers richardjgowers left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@jbarnoud jbarnoud left a comment

Choose a reason for hiding this comment

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

Each method is covered by two tests. Each of these pairs can be grouped in a parametrized test.

def test_minor_pair_2(self):
val = nuclinfo.minor_pair(self.u, 20, 5, seg1='RNAA', seg2='RNAA')
assert_almost_equal(val, 4.356, decimal=3)
def test_minor_pair_1(u):
Copy link
Contributor

Choose a reason for hiding this comment

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

test_minor_pair_1 and test_minor_pair_2 can be grouped in a parametrized test_minor_pair.

def test_phase_cp_2(self):
val = nuclinfo.phase_cp(self.u, seg='RNAA', i=21)
assert_almost_equal(val, 16.199, decimal=3)
def test_major_pair_1(u):
Copy link
Contributor

Choose a reason for hiding this comment

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

test_major_pair_* can be grouped in a parametrized test.

@richardjgowers richardjgowers merged commit 53410cd into MDAnalysis:develop Jul 26, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants