cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

wrong unit test test_update_field_success_on_retry #431

Closed aogier closed 5 years ago

aogier commented 5 years ago

Bug Description

Hi, I'd like to point out that test_update_field_success_on_retry uses a wrong mock implementation. In fact in order to invalidate test you could place a fetch call just before asserts, but the entire linked push should be clear enough if you care to give it a look.

While I'm still not capable to produce a fix, I could point out that a mock should work with callables and not called functions so while I'm studying for a fix please be aware of that.

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

Checkout and run this commit.

2. What you expected to happen

Test passing :P

aogier commented 5 years ago

the correct PoC commit is lost squashing. Anyway it is enough to add a doc.fetch() before this line