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

[WIP]Pytest Style analysis/test_align.py #1546

Merged
merged 4 commits into from Aug 3, 2017

Conversation

Projects
None yet
3 participants
@utkbansal
Member

utkbansal commented Jul 23, 2017

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?
@kain88-de

This comment has been minimized.

Member

kain88-de commented Jul 26, 2017

build fails

@kain88-de

This comment has been minimized.

Member

kain88-de commented Jul 29, 2017

build still fails

@utkbansal

This comment has been minimized.

Member

utkbansal commented Jul 30, 2017

@kain88-de Build passed without changing anything.

assert_equal(rot, np.eye(3))
assert_equal(rmsd, None)
assert rmsd is None

This comment has been minimized.

@kain88-de

kain88-de Jul 30, 2017

Member

I have a feeling the first 3 tests can be parametrized.

This comment has been minimized.

@utkbansal

utkbansal Aug 1, 2017

Member

What do I name it?

This comment has been minimized.

@kain88-de

kain88-de Aug 3, 2017

Member

test_rotation_matrix_input?

This comment has been minimized.

@utkbansal
err_msg="RMSD calculation between 1st and last "
"AdK frame gave wrong answer")
assert_almost_equal(rms.rmsd(last_frame, first_frame, superposition=True), rmsd, 6, err_msg="error: rmsd() is not symmetric")
assert_almost_equal(rmsd, 6.820321761927005, 5, err_msg="RMSD calculation between 1st and last AdK frame gave wrong answer")

This comment has been minimized.

@kain88-de

kain88-de Jul 30, 2017

Member

please avoid these super long lines. The pep8 standard is 80 chars

def test_rmsd_deprecated(self, universe, reference):
last_atoms_weight = universe.atoms.masses
A = universe.trajectory[0]
B = reference.trajectory[-1]
with warnings.catch_warnings(record=True) as warn:

This comment has been minimized.

@kain88-de

kain88-de Jul 30, 2017

Member

can use the warnings catcher from pytest pytest.warns

(a, b, w),
(a.astype(np.int), b.astype(np.int), w.astype(np.float32))
))
def test_rotation_matrix_input(self, a, b, weights): # TODO: Fix the name

This comment has been minimized.

@kain88-de

kain88-de Aug 3, 2017

Member

you left the fixme

@kain88-de kain88-de merged commit 858069f into MDAnalysis:develop Aug 3, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment