Skip to content

Commit

Permalink
Fix matplotlib showing the plots instead of saving them in doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Oct 20, 2023
1 parent 7b6ec43 commit 8e11f52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions papyri/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,10 @@ def dbg(*args):
class PapyriDocTestRunner(doctest.DocTestRunner):
def __init__(slf, *args, **kwargs):
super().__init__(*args, **kwargs)
import matplotlib

matplotlib.use("agg")

slf.figs = []
slf.fig_managers = _pylab_helpers.Gcf.get_all_fig_managers()
assert (len(slf.fig_managers)) == 0, f"init fail in {qa} {len(slf.fig_managers)}"
Expand Down

0 comments on commit 8e11f52

Please sign in to comment.