我寫的測試用例這樣的結構:如何正確運行unittest測試用例?
import unittest
....
url = TestObjects.host #url host
class AuthInitial(unittest.TestCase):
def setUp(self):
self.driver = TestObjects.driver #start browser
def test_name(self):
some test_logic in browser
def tearDown(self):
self.assertEqual()
self.driver.close()
if __name__ == '__main__':
unittest.main()
當我運行通過nosetests命令測試我得到一個錯誤(winerror-10061)
如何正確地開始測試? 每次我需要關閉並打開瀏覽器嗎?
出現此錯誤後,問題與測試本身無關,但與您的代碼邏輯無關。此錯誤與連接有關。 http://stackoverflow.com/questions/13773024/python-connectin-refused-10061 – 2015-04-02 16:07:54