鼻子Python测试

时间:2020-03-21 17:16:41

标签: python nose pdb

请问有人可以帮我吗,这是(Pdb)列出(Pdb)的意思。在教科书《 Python测试》中,没有人能解决这个问题。非常感谢你...

(Pdb) up
(Pdb) up`
(Pdb) list


 def test_add_method_returns_correct_result(self):
   print
   print
   print "Hello"
   self.assertEqual(3, self.calc.add(2,2))

 def test_add_method_raises_typeerror_if_not_ints(self):

   self.assertRaises(TypeError, self.calc.add, "Hello",
   "World")

if __name__ == '__main__': 
 (Pdb)self.calc.add(4,4) 
 (Pdb)
  # why sometimes is down here only this line if __name__ == 
  '__main__': 
  # and sometimes is here also 
  #**self.calc.add(4,4)**

1 个答案:

答案 0 :(得分:1)

(pdb)向上: 命令up用于从堆栈中向上移动一帧

(pdb)列表: 显示当前正在运行的程序的源代码

您可以在python文档中找到有关pdb命令的更多信息: https://docs.python.org/3/library/pdb.html