Refactor tests for nose