Every person who, having been subpenaed as a witness under this chapter to give testimony or to produce documents, willfully makes default, or who, having appeared, refuses to answer any question pertinent to the contested election case, shall be deemed guilty of a misdemeanor punishable by fine of not more than $1,000 nor less than $100 or imprisonment for not less than one month nor more than twelve months, or both.