2017-04-05 3 views
0

私はテストケース名私のティアダウンメソッドに必要です、python + nosetestでテストケース名を取得する方法はありますか?python + nosetestsでテストケース名を取得するには?

def test_google(self): 
    self.driver = webdriver.Firefox() 
    self.driver.get("http://www.google.com") 

def tearDown(self): 
    print ("Need to get test case name") 
    self.driver.quit() 
+0

を印刷します 印刷self._testMethodName を試してみてください? – bhansa

+0

@Bhansa:出力はテストケース名、つまりtest_googleである必要があります –

+0

[この回答を参照してください、役立ちます](http://stackoverflow.com/questions/7797442/how-to-get-currently-running-testcase-name-from-testsuite -in-unittest) – bhansa

答えて

0

が、それは結果がどうあるべきかのテストケース名

関連する問題