Switch unit tests to use pytest idioms throughout.