ddt文件驅動使用中的坑

代碼中加了一個註釋

	···
	    @ddt.data(
	        ['郵箱格式不正確','111'],
	        ['郵箱格式不正確','111@163'],
	        ['郵箱格式不正確','111@163@'],
	        ['郵箱格式不正確','[email protected]']
	        )
	    @ddt.unpack
	···

	    @ddt.data(*data)
	    def test_register(self,data):
	        error_info,email = data
	        email_error = self.login.email_error(error_info,email)
	        self.assertTrue(email_error)

報錯信息:

@ddt.data(*data) ^
IndentationError: unexpected indent

解決方法:

刪除註釋

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章