fix KeyError that happens when test dir is not created