8000 Add test for _num_to_string method used in __call__ of LogFormatter … · matplotlib/matplotlib@7d6b0c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d6b0c8

Browse files
patniharshitphobson
authored andcommitted
Add test for _num_to_string method used in __call__ of LogFormatter (#8598)
Closes #8597
1 parent c047c8e commit 7d6b0c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,13 @@ def test_sublabel(self):
521521
ax.set_xlim(0.5, 0.9)
522522
self._sub_labels(ax.xaxis, subs=np.arange(2, 10, dtype=int))
523523

524+
@pytest.mark.parametrize('val', [1, 10, 100, 1000])
525+
def test_LogFormatter_call(self, val):
526+
# test _num_to_string method used in __call__
527+
temp_lf = mticker.LogFormatter()
528+
temp_lf.axis = FakeAxis()
529+
assert temp_lf(val) == str(val)
530+
524531

525532
class TestFormatStrFormatter(object):
526533
def test_basic(self):

0 commit comments

Comments
 (0)
0