自从Xcode 10.1(或许是10)之后,当我创建一个单元测试文件时,我没有调用super.tearDown()和super.setUp()。
我在发布说明中没有看到这样的更改。
所以我的问题是,我是否仍然需要编写super.tearDown()和super.setUp()?
class SomethingTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}