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

Skip to content

Commit b633253

Browse files
committed
TST: Test for new pos format
1 parent f51d58c commit b633253

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ def test_formatstrformatter():
366366
tmp_form = mticker.StrMethodFormatter('{x:05d}')
367367
nose.tools.assert_equal('00002', tmp_form(2))
368368

369+
# test str.format() style formatter with `pos`
370+
tmp_form = mticker.StrMethodFormatter('{x:03d}-{pos:02d}')
371+
nose.tools.assert_equal('002-01', tmp_form(2, 1))
372+
373+
369374
if __name__ == '__main__':
370375
import nose
371376
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)