Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd36aa3

Browse files
committed
Make axisartist.grid_finder pseudo-tests real.
1 parent a580008 commit bd36aa3

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

lib/mpl_toolkits/axisartist/grid_finder.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,3 @@ def __call__(self, direction, factor, values):
338338
r = [self._format_dict.get(k, v) for k, v in zip(values,
339339
fallback_strings)]
340340
return r
341-
342-
343-
if __name__ == "__main__":
344-
locator = MaxNLocator()
345-
locs, nloc, factor = locator(0, 100)
346-
347-
fmt = FormatterPrettyPrint()
348-
349-
print(fmt("left", None, locs))
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from __future__ import (absolute_import, division, print_function,
2+
unicode_literals)
3+
4+
from mpl_toolkits.axisartist.grid_finder import (
5+
FormatterPrettyPrint,
6+
MaxNLocator)
7+
8+
9+
def test_pretty_print_format():
10+
locator = MaxNLocator()
11+
locs, nloc, factor = locator(0, 100)
12+
13+
fmt = FormatterPrettyPrint()
14+
15+
assert fmt("left", None, locs) == \
16+
[r'$\mathdefault{%d}$' % (l, ) for l in locs]

0 commit comments

Comments
 (0)