Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7d6b0c8

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

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎lib/matplotlib/tests/test_ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_ticker.py
+7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.