Port to py.test