Skip to content

Commit b2c682e

Browse files
authored
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.
1 parent 28a4621 commit b2c682e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymc3/tests/test_examples.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
import pytest
2121
import theano
2222
from pymc3.theanof import floatX
23+
from packaging import version
2324

2425
from .helpers import SeededTest
2526

26-
matplotlib.use('Agg', warn=False)
27+
if version.parse(matplotlib.__version__) < version.parse('3.3'):
28+
matplotlib.use('Agg', warn=False)
29+
else:
30+
matplotlib.use('Agg')
2731

2832

2933
def get_city_data():

0 commit comments

Comments
 (0)