简体   繁体   English

来自unittest.TestCase的tearDownClass的工作流程如何?

[英]How is the workflow of tearDownClass from unittest.TestCase?

How is the workflow of tearDownClass from unittest.TestCase ? 如何通过unittest.TestCase进行tearDownClass的工作流程? Is it called after each test method, or just in the end to "close the connection" of the test class? 是在每个测试方法之后调用,还是只是在最后“关闭连接”测试类?

Its explanation wasn't clarifying for me: https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown 它的解释对我来说还不清楚: https : //docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown

It is called when you deallocate the class: in other words, when you finish with all of the test methods. 在取消分配类时调用该方法:换句话说,当您完成所有测试方法时。 It's a direct cognate to the setUpClass class method, but at the opposite end of execution. 它与setUpClass类方法直接相关,但在执行的另一端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM