Support for running the test suite with pytest

This is a follow up for #1449