相关疑难解决方法(0)

Xcode 10和super.tearDown

从Xcode 10.1(也许是10)开始,当我创建单元测试文件时,我没有调用super.tearDown()和super.setUp()。

我没有在发行说明中看到这种变化。

在文档中https://developer.apple.com/documentation/xctest/xctestcase/understanding_setup_and_teardown_for_test_method仍在这里。

所以我的问题还是应该编写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 …
Run Code Online (Sandbox Code Playgroud)

xcode teardown xctest

4
推荐指数
1
解决办法
475
查看次数

标签 统计

teardown ×1

xcode ×1

xctest ×1