TST: protect matplotlib import in tests