Closed bblommers closed 3 years ago
Thanks for the report. It mostly seems like an upstream issue in unittest.mock since the commit was made there too and backported. Can you confirm the issue with unittest.mock
on latest Python 3.9? Can you please add a simple reproducer without moto or other dependencies so that it will be good to debug and also add the test to mock codebase for this.
Hi @tirkarthi, I haven't been able to create a simple reproducer, I'm afraid. Some more investigation did show that we weren't using mocks properly in our project, and this change just highlighted that. Changing our approach to mocks made the error go away.
If/when I do manage to get a reproducible test case (without butchering the unittest.mock usage) I'll create an issue upstream.
Thanks for the response!
Hi,
Our project depends on mock and starting breaking with the release 4.0.3 It looks like it's due to this change: https://github.com/testing-cabal/mock/commit/902eea1b1d5c8652d9ac34dcce7a2cc08f3be76d#diff-8c27cb0892437c6ed89046ff1e003343bbab422f3f030a41d3a903c7fca93089L1548, which essentially removes the idempotency of the
stop()
-method. This if-statement looked to be specifically introduced to support idempotency (see the original commit), so I was wondering what the reasoning was behind this reversal?(Stack trace of how mock now fails for us can be found here: https://github.com/spulec/moto/issues/3535)