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_leaflet.py #1551

Merged
merged 2 commits into from
Jul 29, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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


lipid_head_string = "name PO4"

def test_leaflet_finder(self, universe, lipid_heads):
from MDAnalysis.analysis.leaflet import LeafletFinder
Copy link
Member

Choose a reason for hiding this comment

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

import at the head of the file

del self.universe
del self.lipid_heads
del self.lipid_head_string
class TestLeafletFinder(object):
Copy link
Member

Choose a reason for hiding this comment

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

please remove the class

@staticmethod
@pytest.fixture()
def universe():
return MDAnalysis.Universe(Martini_membrane_gro, Martini_membrane_gro)
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be return MDAnalysis.Universe(Martini_membrane_gro)

def lipid_heads(self, universe):
return universe.select_atoms("name PO4")

lipid_head_string = "name PO4"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be defined at the beginning, and the variable name should be in capital if the class get removed. It should certainly not be defined in the class scope, in between two methods.

def test_leaflet_finder(self):
@pytest.fixture()
def lipid_heads(self, universe):
return universe.select_atoms("name PO4")
Copy link
Contributor

Choose a reason for hiding this comment

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

This could use the lipid_head_string variable.

@utkbansal
Copy link
Member Author

@kain88-de @jbarnoud Better now?

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

@kain88-de @jbarnoud Anything else to do?

@jbarnoud jbarnoud merged commit b4e044b into MDAnalysis:develop Jul 29, 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