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

Improve test for LogFormatter  #8597

Copy link
Copy link
Closed
@tacaswell

Description

@tacaswell
Issue body actions

Bug report

Bug summary

The tests for LogFormatter do not explicitly test the return value of __call__ which allowed this bug #8594 to slip through.

We extensively test pprint_val and that __call__ correctly skips formatting ticks when required

Code for reproduction

(prior to merging and backporting #8594 )

In [31]: fig, ax = plt.subplots()

In [32]: ax.xaxis.set_major_formatter(lf)

In [33]: lf(5)
Out[33]: ''

In [34]: lf(50)
Out[34]: ''

In [35]: lf(100)

In [36]: print(str(lf(100)))
None

In [37]: print(str(lf(1)))
None

In [38]: print(str(lf(10)))
None

In [39]: print(str(lf(10000)))
None

Actual outcome

Expected outcome

Not None!

Matplotlib version

  • Operating System: any
  • Matplotlib Version: 2.0-2.0.1
  • Python Version: any
  • Jupyter Version (if applicable):
  • Other Libraries:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.