我可以使用pytest的断言解包来运行普通的应用程序吗?

时间:2017-11-12 15:55:24

标签: python pytest assert

标准Python只会引发异常,但不会显示导致sys.excepthook语句失败的不匹配值。 Pytest,也可能是其他测试框架,很好地解包了assert语句的值,以显示问题所在。有没有办法修补单元测试可用于我的普通python程序的行为,例如使用SAXReader reader = new SAXReader(); Document document = reader.read("http://localhost:8000/"); System.out.println(document.getText());

0 个答案:

没有答案