Atheism was illegal in the Swedish era , and church attendance was mandatory by law , with punishments for encouraging non-attendance . Atheism was illegal in the Swedish era , and church attendance was mandatory by law , with punishments for encouraging non-attendance .