Skip to content

Commit

Permalink
Improve doc of tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Jun 20, 2023
1 parent e052456 commit 0a19a48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Define commonly used text fixtures.
- Fixtures that are formulae (e.g., LiFePO4) essentially returns the appropriate pymatgen Structure or Molecule based
on the most common known structure.
- Fixtures that are prefixed with a graph returns a (structure, graph, state) tuple.
Define commonly used text fixtures. These are meant to be reused in unittests.
- Fixtures that are formulae (e.g., LiFePO4) returns the appropriate pymatgen Structure or Molecule based on the most
commonly known structure.
- Fixtures that are prefixed with `graph_` returns a (structure, graph, state) tuple.
Given that the fixtures are unlikely to be modified by the underlying code, the fixtures are set with a scope of
"session". In the event that future tests are written that modifies the fixtures, these can be set to the default scope
Expand All @@ -20,8 +20,10 @@

def get_graph(structure, cutoff):
"""
Helper class to generate DGL graph from an input Structure or Molecule.
Returns:
Structure, Graph, State
Structure/Molecule, Graph, State
"""
element_types = get_element_list([structure])
if isinstance(structure, Structure):
Expand Down Expand Up @@ -79,7 +81,6 @@ def graph_CH4(CH4):
Returns:
Molecule, Graph, State
"""

return get_graph(CH4, 2.0)


Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_megnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from matgl.models import MEGNet


class TestMEGNetTest:
class TestMEGNet:
def test_megnet(self, graph_MoS):
structure, graph, state = graph_MoS
model = MEGNet(
Expand Down

0 comments on commit 0a19a48

Please sign in to comment.