Skip to content

Commit

Permalink
STY/TST: pep8 fixes for test_dates
Browse files Browse the repository at this point in the history
  • Loading branch information
cimarronm committed Sep 19, 2014
1 parent 34230a7 commit 63c52f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_coding_standards.py
Expand Up @@ -96,7 +96,6 @@
'*/matplotlib/tri/triinterpolate.py',
'*/matplotlib/tests/test_axes.py',
'*/matplotlib/tests/test_bbox_tight.py',
'*/matplotlib/tests/test_dates.py',
'*/matplotlib/tests/test_delaunay.py',
'*/matplotlib/tests/test_dviread.py',
'*/matplotlib/tests/test_image.py',
Expand Down
15 changes: 9 additions & 6 deletions lib/matplotlib/tests/test_dates.py
Expand Up @@ -162,9 +162,9 @@ def test_DateFormatter():
def test_date_formatter_callable():
scale = -11
locator = mock.Mock(_get_unit=mock.Mock(return_value=scale))
callable_formatting_function = lambda dates, _: \
[dt.strftime('%d-%m//%Y') for dt in dates]
callable_formatting_function = (lambda dates, _:
[dt.strftime('%d-%m//%Y') for dt in dates])

formatter = mdates.AutoDateFormatter(locator)
formatter.scaled[-10] = callable_formatting_function
assert_equal(formatter([datetime.datetime(2014, 12, 25)]),
Expand Down Expand Up @@ -223,7 +223,8 @@ def test_auto_date_locator():
def _create_auto_date_locator(date1, date2):
locator = mdates.AutoDateLocator()
locator.create_dummy_axis()
locator.set_view_interval(mdates.date2num(date1), mdates.date2num(date2))
locator.set_view_interval(mdates.date2num(date1),
mdates.date2num(date2))
return locator

d1 = datetime.datetime(1990, 1, 1)
Expand Down Expand Up @@ -275,8 +276,10 @@ def _create_auto_date_locator(date1, date2):
'1990-01-01 00:00:40+00:00']
],
[datetime.timedelta(microseconds=1500),
['1989-12-31 23:59:59.999507+00:00', '1990-01-01 00:00:00+00:00',
'1990-01-01 00:00:00.000502+00:00', '1990-01-01 00:00:00.001005+00:00',
['1989-12-31 23:59:59.999507+00:00',
'1990-01-01 00:00:00+00:00',
'1990-01-01 00:00:00.000502+00:00',
'1990-01-01 00:00:00.001005+00:00',
'1990-01-01 00:00:00.001508+00:00']
],
)
Expand Down

0 comments on commit 63c52f8

Please sign in to comment.