Refactored a few tests to use pytest and fixtures