-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up After Test DBs #10
Conversation
move db clean up to defer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your pull requests are really good! Just one minor issue with duplicate client.Delete
.
@@ -1724,6 +1729,7 @@ func TestSeed(t *testing.T) { | |||
if _, err := client.Create(name); err != nil { | |||
t.Error(err) | |||
} | |||
defer client.Delete(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client.Delete
at the end of the method can then be deleted, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the Delete at the end of this method. Are you talking about this line?
https://github.com/zemirco/couchdb/pull/10/files#diff-51565ad50d7426213c2f33579f6f0e71L567
It looks like I missed one. I'll updated it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was talking about the one you missed. I just could not create the comment at that line since you didn't touch it in your pull requests. GitHub just doesn't allow adding comments to lines which were not modified
Cleans up test dbs created during tests.
Moves current "deletes" to defer after creation, which prevents orphan dbs from being left behind when a test errors out.