From b2c682e7043b652a2affb72ff64772e4c360b679 Mon Sep 17 00:00:00 2001 From: rpgoldman Date: Mon, 20 Jul 2020 15:41:19 -0500 Subject: [PATCH] Fix Matplotlib type error for tests (#4023) * Fix for issue 4022. Check for support for `warn` argument in `matplotlib.use()` call. Drop it if it causes an error. * Alternative fix. --- pymc3/tests/test_examples.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pymc3/tests/test_examples.py b/pymc3/tests/test_examples.py index 7d431dfd076..9afdac1079c 100644 --- a/pymc3/tests/test_examples.py +++ b/pymc3/tests/test_examples.py @@ -20,10 +20,14 @@ import pytest import theano from pymc3.theanof import floatX +from packaging import version from .helpers import SeededTest -matplotlib.use('Agg', warn=False) +if version.parse(matplotlib.__version__) < version.parse('3.3'): + matplotlib.use('Agg', warn=False) +else: + matplotlib.use('Agg') def get_city_data():