#20222 closed defect (fixed)
Oneoff doctest failures in a fresh install because of matplotlib
Reported by:  defeo  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  build  Keywords:  
Cc:  jdemeyer, embray, nthiery  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Erik Bray, Julian Rüth 
Report Upstream:  N/A  Work issues:  
Branch:  7169df8 (Commits)  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
When running Sage doctests for the very first time (with an empty DOT_SAGE
directory):
sage t long src/sage/geometry/fan.py ********************************************************************** File "src/sage/geometry/fan.py", line 2887, in sage.geometry.fan.?.plot Failed example: fan.plot() Expected: Graphics object consisting of 31 graphics primitives Got: doctest:273: UserWarning: Matplotlib is building the font cache using fclist. This may take a moment. Graphics object consisting of 31 graphics primitives ********************************************************************** 1 item had failures: 1 of 3 in sage.geometry.fan.?.plot [492 tests, 1 failure, 9.60 s] sage t long src/sage/categories/coxeter_groups.py ********************************************************************** File "src/sage/categories/coxeter_groups.py", line 1681, in sage.categories.coxeter_groups.CoxeterGroups.ElementMethods.bruhat_lower_cov ers Failed example: P.show() Expected nothing Got: doctest:273: UserWarning: Matplotlib is building the font cache using fclist. This may take a moment. ********************************************************************** 1 item had failures: 1 of 15 in sage.categories.coxeter_groups.CoxeterGroups.ElementMethods.bruhat_lower_covers [461 tests, 1 failure, 18.31 s]
Of course, the failures go away when the tests are rerun. Any way we can avoid these failures?
Change History (23)
comment:1 Changed 5 years ago by
 Cc embray nthiery added
comment:2 Changed 5 years ago by
Still don't have automated builds of the sagemathdevelop container running yet, but hope to have that sooner or later.
comment:3 Changed 4 years ago by
 Component changed from doctest framework to build
 Priority changed from minor to major
comment:4 followup: ↓ 5 Changed 4 years ago by
Can't we simply ignore these warnings?
comment:5 in reply to: ↑ 4 Changed 4 years ago by
Replying to jdemeyer:
Can't we simply ignore these warnings?
What's the standard way to ignore warnings in doctests, again?
comment:6 followup: ↓ 7 Changed 4 years ago by
I wonder if the initial sage startup shouldn't also take care of this.
comment:7 in reply to: ↑ 6 Changed 4 years ago by
Replying to embray:
I wonder if the initial sage startup shouldn't also take care of this.
That's not really possible because the relevant matplotlib files are user files (inside $DOT_SAGE
, which is typically in $HOME
), not system files.
comment:8 Changed 4 years ago by
I think I see what you're sayingI'm so used at this point to running my own copy of sage that it's warped my viewpoint in ugly ways :)
But isn't there some initial creation of user files in $DOT_SAGE
the first time a user runs Sage? That's what I meant.
comment:9 Changed 4 years ago by
Upstream issue: https://github.com/matplotlib/matplotlib/issues/5836
comment:10 Changed 4 years ago by
 Branch set to u/jdemeyer/one_off_doctest_failures_in_a_fresh_install
comment:11 Changed 4 years ago by
 Commit set to e2083fc285507f658ee1babe515118a0208977fd
 Status changed from new to needs_review
New commits:
e2083fc  Build Matplotlib font cache before running doctests

comment:12 Changed 4 years ago by
 Milestone changed from sage7.1 to sage8.0
 Status changed from needs_review to positive_review
Huh, I thought this was already fixed. I haven't run into it in a while.
comment:13 Changed 4 years ago by
 Reviewers set to Erik Bray
comment:14 Changed 4 years ago by
 Status changed from positive_review to needs_work
sage t long warnlong 81.6 src/sage/tests/startup.py ********************************************************************** File "src/sage/tests/startup.py", line 6, in sage.tests.startup Failed example: 'numpy' in sys.modules Expected: False Got: True ********************************************************************** File "src/sage/tests/startup.py", line 8, in sage.tests.startup Failed example: 'pyparsing' in sys.modules Expected: False Got: True ********************************************************************** 1 item had failures: 2 of 7 in sage.tests.startup [6 tests, 2 failures, 1.47 s]
comment:15 Changed 4 years ago by
 Summary changed from Oneoff doctest failures in a fresh install to Oneoff doctest failures in a fresh install because of matplotlib
comment:16 Changed 4 years ago by
 Commit changed from e2083fc285507f658ee1babe515118a0208977fd to dd1dfe4b8b729499c09ef0bb301e13d25c74297f
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
dd1dfe4  Build Matplotlib font cache before running doctests

comment:17 Changed 4 years ago by
 Commit changed from dd1dfe4b8b729499c09ef0bb301e13d25c74297f to 59e671e868764eba3a4bbd62977460f069ce99b2
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
59e671e  Build Matplotlib font cache before running doctests

comment:18 Changed 4 years ago by
 Description modified (diff)
 Status changed from needs_work to needs_review
New version which imports matplotlib in a forked child process.
comment:19 Changed 3 years ago by
 Commit changed from 59e671e868764eba3a4bbd62977460f069ce99b2 to 7169df8578eeb59a0de4b649a632f3db2b7c0a4a
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
7169df8  Build Matplotlib font cache before running doctests

comment:20 Changed 3 years ago by
 Reviewers changed from Erik Bray to Erik Bray, Julian Rüth
 Status changed from needs_review to positive_review
comment:21 Changed 3 years ago by
 Branch changed from u/jdemeyer/one_off_doctest_failures_in_a_fresh_install to 7169df8578eeb59a0de4b649a632f3db2b7c0a4a
 Resolution set to fixed
 Status changed from positive_review to closed
comment:22 Changed 3 years ago by
 Commit 7169df8578eeb59a0de4b649a632f3db2b7c0a4a deleted
I'm seeing these failures again in 8.3.beta1.
comment:23 Changed 3 years ago by
See #25375 for a followup ticket.
Running tests inside a fresh docker container could be a good way to check for problems like this.