#13: massive test refactor to make the tests factor and use pytest idioms