       completionSteps += 1
     }
     try CoreDataMigration.migrateStore(from: sourceURL, to: targetURL, targetVersion: SampleModelVersion.version3, deleteSource: true, progress: progress)
-    
+
     let migratedContext = NSManagedObjectContext(model: SampleModelVersion.version3.managedObjectModel(), storeURL: targetURL)
     let makers = try migratedContext.fetch(NSFetchRequest<NSManagedObject>(entityName: "Maker"))
     XCTAssertEqual(makers.count, 11)
-    
+
     makers.forEach { (maker) in
       let name = maker.value(forKey: "name") as! String
       maker.setValue("--\(name)--", forKey: "name")
     }
     try migratedContext.save()
-    
+
     XCTAssertEqual(completionSteps, 2)
     XCTAssertEqual(completion, 1.0)
-    
+
     XCTAssertFalse(FileManager.default.fileExists(atPath: sourceURL.path))
     XCTAssertTrue(FileManager.default.fileExists(atPath: targetURL.path))
-    
+
     migratedContext._fix_sqlite_warning_when_destroying_a_store()
     token.invalidate()
   }

        XCTAssertEqual(previousOwners.count, 0)
      }
    }
    
    try migratedContext.save()
    XCTAssertTrue(FileManager.default.fileExists(atPath: targetURL.path))
    XCTAssertTrue(FileManager.default.fileExists(atPath: sourceURL.path))
    
    migratedContext._fix_sqlite_warning_when_destroying_a_store()
    
    try NSPersistentStoreCoordinator.destroyStore(at: sourceURL)
  }
  
  func testMigrationFromVersion1ToVersion3() throws {
    let bundle = Bundle(for: CoreDataMigrationsTests.self)
    let _sourceURL = bundle.url(forResource: "SampleModelV1", withExtension: "sqlite")!
    
    // Being the test run multiple times, we create an unique copy for every test
    let uuid = UUID().uuidString
    let sourceURL = bundle.bundleURL.appendingPathComponent("SampleModelV1_copy-\(uuid).sqlite")
    try FileManager.default.copyItem(at: _sourceURL, to: sourceURL)
    XCTAssertTrue(FileManager.default.fileExists(atPath: sourceURL.path))
    
    let version = SampleModelVersion(persistentStoreURL: sourceURL as URL)
    
    XCTAssertTrue(version == .version1)
    
    let targetURL = URL.temporaryDirectoryURL.appendingPathComponent("SampleModel").appendingPathExtension("sqlite")
    let progress = Progress(totalUnitCount: 1)
    var completionSteps = 0

      }
    }
  }

  func testMigrationFromNotExistingPersistentStore() {
    let url = URL(fileURLWithPath: "/path/to/nothing.sqlite")
    XCTAssertThrowsError(try CoreDataMigration.migrateStore(at: url, targetVersion: SampleModelVersion.version2), "The store shouldn't exist.") { (error) in
