提交 6d4c8bee 编写于 作者: M Michael Boulton

Remove try/finally block

http://pytest.org/dev/yieldfixture.html

    With pytest fixture functions, the “after yield” part will always be invoked, independently from the exception status of the test function which uses the fixture.
上级 1ad6f680
......@@ -56,11 +56,10 @@ def fake_broker():
# print('Setup broker')
broker = FakeBroker()
try:
yield broker
finally:
# print('Teardown broker')
broker.finish()
yield broker
# print('Teardown broker')
broker.finish()
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册