Convert tests to py.test