Skip to content

Pytest Style analysis/test_leaflet.py#1551

Merged
jbarnoud merged 2 commits into
MDAnalysis:developfrom
utkbansal:analysis-leaflet
Jul 29, 2017
Merged

Pytest Style analysis/test_leaflet.py#1551
jbarnoud merged 2 commits into
MDAnalysis:developfrom
utkbansal:analysis-leaflet

Conversation

@utkbansal
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants