Skip to content

Commit

Permalink
Fix python setup.py test to run doctests. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelson authored and bjlittle committed Jan 17, 2019
1 parent 502d014 commit c6ef762
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cf_units/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2015 - 2018, Met Office
# (C) British Crown Copyright 2015 - 2019, Met Office
#
# This file is part of cf-units.
#
Expand Down Expand Up @@ -1878,7 +1878,7 @@ def utime(self):
... calendar=cf_units.CALENDAR_STANDARD)
>>> ut = u.utime()
>>> print(ut.num2date(2))
1970-01-01 02:00:00.000006
1970-01-01 02:00:00
"""
if self.calendar is None:
Expand Down Expand Up @@ -1924,8 +1924,8 @@ def date2num(self, date):
>>> import datetime
>>> u = cf_units.Unit('hours since 1970-01-01 00:00:00',
... calendar=cf_units.CALENDAR_STANDARD)
>>> u.date2num(datetime.datetime(1970, 1, 1, 5))
5.00000000372529
>>> round(u.date2num(datetime.datetime(1970, 1, 1, 5)))
5.0
>>> u.date2num([datetime.datetime(1970, 1, 1, 5),
... datetime.datetime(1970, 1, 1, 6)])
array([5., 6.])
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test = pytest

[tool:pytest]
testpaths =
cf_units/tests
cf_units/
addopts =
-ra
-v
Expand Down

0 comments on commit c6ef762

Please sign in to comment.