Refactored tests so they're more pytest-ish.