Skip to content

Suppress/fix some test warnings. #11705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 19, 2018

The only remaining test that throws a warning is
test_image.py::test_full_invalid ("converting a masked element to nan"),
which I didn't suppress in the test because I think that should indeed
not throw (we don't throw warnings when passing partially-nan data
either).

(I think ultimately we should make CI fail in the presence of warnings;
looks like this can be done by adding the suitable warnings filter to
pytest.ini https://docs.pytest.org/en/latest/warnings.html.)

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@tacaswell
Copy link
Member

This is failing on windows which does not really have a float128 type (iirc).

@tacaswell tacaswell added this to the v3.0 milestone Jul 19, 2018
@anntzer anntzer force-pushed the warningslesstests branch from 886be24 to f936ce8 Compare July 20, 2018 09:29
@anntzer
Copy link
Contributor Author

anntzer commented Jul 20, 2018

should be fixed

@anntzer anntzer force-pushed the warningslesstests branch from f936ce8 to da6fd6a Compare July 20, 2018 10:36
@@ -1112,7 +1112,8 @@ def _transform(self, a):
"""
Inplace transformation.
"""
masked = np.abs(a) > self.linthresh
with np.errstate(invalid="ignore"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this throw an invalid warning in the first place? It's not obvious to me that _transform should be getting invalid values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can definitely pass nans in (they're ignored at a later stage, by the low-level path handling machinery).

assert res == is_opentype_cff_font(f)
for f in fontManager.ttflist:
if 'otf' in f.name:
with open(f.name, 'rb') as fd:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not hit when the tests are run. Maybe we have to otf fonts on travis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno, and I can't say I really care about this test given that it's a literaly copy-paste of the function's definition (https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/font_manager.py#L1267).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on this week's call, this is actually a real drop in coverage due to a typo (f.name vs. f.fname)

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix up the typo and not have our test lines execute drop.

@anntzer anntzer force-pushed the warningslesstests branch from da6fd6a to f1aed96 Compare July 23, 2018 19:36
@anntzer
Copy link
Contributor Author

anntzer commented Jul 23, 2018

fixed

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending CI, including coverage of tests not dropping.

The only remaining test that throws a warning is
test_image.py::test_full_invalid ("converting a masked element to nan"),
which I didn't suppress in the test because I think that should indeed
not throw (we don't throw warnings when passing partially-nan data
either).
@anntzer anntzer force-pushed the warningslesstests branch from f1aed96 to c9a8edb Compare July 23, 2018 20:45
@dopplershift
Copy link
Contributor

Anyone know why the csd test would be failing?

@anntzer
Copy link
Contributor Author

anntzer commented Jul 24, 2018

Probably something with numpy 1.15 being just released?

@tacaswell tacaswell merged commit e36fe9a into matplotlib:master Jul 25, 2018
@anntzer anntzer deleted the warningslesstests branch July 25, 2018 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants