当 nosetests 失败时调用 teardown
Calling teardown when nosetests fail
我在设置中创建了一个临时数据库,然后在拆解中将其删除。但是,如果我的测试失败,它永远不会拆解,处理这种情况的最佳做法是什么?
来自鼻子docs
teardown runs if setup has completed successfully, regardless of the
status of the test run.
因此,只要您的临时数据库设置成功,就应该没问题。
我在设置中创建了一个临时数据库,然后在拆解中将其删除。但是,如果我的测试失败,它永远不会拆解,处理这种情况的最佳做法是什么?
来自鼻子docs
teardown runs if setup has completed successfully, regardless of the status of the test run.
因此,只要您的临时数据库设置成功,就应该没问题。