Remove pytest import in utils.

Fixes #592.