Move a side-effectful function out of an assert statement.