Switching string comp to dict/list comp in tests