Better implementation for skip tests if the system does not have matplotlib installed