You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add note about using finally
@tswast reminded me about `finally` the other day and I thought I'd add a note about it in the authoring guide
* Add example of finally
Copy file name to clipboardexpand all lines: AUTHORING_GUIDE.md
+32
Original file line number
Diff line number
Diff line change
@@ -451,6 +451,38 @@ All temporary resources should be explicitly deleted when testing is
451
451
complete. Use pytest's fixture for cleaning up these resouces instead
452
452
of doing it in test itself.
453
453
454
+
We recommend using `finally` to ensure that resource deletion occurs even if there is an error on creation. For example, this fixture creates a Dataproc cluster and tears it down regardless of errors during creation.
0 commit comments