Skip to content

Commit

Permalink
delete doctest.testmod() if __name__ == "__main__"
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Jul 25, 2023
1 parent 1d3ff84 commit 26b3b5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
6 changes: 0 additions & 6 deletions pymatgen/core/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,3 @@ def __repr__(self):

class CompositionError(Exception):
"""Exception class for composition errors."""


if __name__ == "__main__":
import doctest

doctest.testmod()
10 changes: 2 additions & 8 deletions pymatgen/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,9 @@ def get_mass():
"""

def wrap(f):
def wrap(func):
def wrapped_f(*args, **kwargs):
val = f(*args, **kwargs)
val = func(*args, **kwargs)
unit_type = _UNAME2UTYPE[unit]

if isinstance(val, (FloatWithUnit, ArrayWithUnit)):
Expand All @@ -816,9 +816,3 @@ def wrapped_f(*args, **kwargs):
return wrapped_f

return wrap


if __name__ == "__main__":
import doctest

doctest.testmod()

0 comments on commit 26b3b5b

Please sign in to comment.