Each XCTest method is run sequentially (one at the moment)
To test Core Data I often create in memory Persistance Store, here you have good snipped: code using this kind of MOC you always have clear core data state
Please check also this Rays tutorial