-
Notifications
You must be signed in to change notification settings - Fork 104
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
Mock call assertion fails in 1.1.x #283
Comments
That certainly is odd. I don't suppose you can boil it down to a more pithy example? |
No. So far was unsuccessful in making a dummy example with the same failure. |
Not an expert by any means, but how's this?
With mock 1.0.1, the test passes. With mock 1.1.3, the assert fails. With Python 3.4.3 (and altered import), the test passes. |
This fails on Python 3.5/3.6. Filing upstream |
Huh, well at least it might explain ours. :P |
@miki725 if you can't reproduce it thats fine - can you at least verify against Python 3.5 to see if its a backport specific issue or not? |
sure. Ill try to do that this weekend. my work computer does not have 3.5 installed already... |
This version is installed on my local system and all the tests are passed. However, on travis systems, somehow, the tests aren't passing. Similar problems with mock have been reported (testing-cabal/mock#283). So, setting the version to what works locally. Without this, the build fails because of a call that is made as expected, but mock thinks the calls are different See: (https://travis-ci.org/thakkarparth007/mailer/jobs/99008675)
This repo is only for issues that are specific to the backport. |
Im experiencing a very strange issue with
mock>=1.1
which causes mock call assertion to fail in one of my projects:If you take a look at the assertion error, both calls are actually identical so the mock somehow cant detect that even though it prints identical mock calls in the assertion message.
Test passes perfectly on
mock==1.0.x
versions but something inmock>=1.1.x
causes the test to fail. I tried to replicate the bug by using a dummy example however so far have not been successful. Due to that I cant produce a simple test case which could be included in mock test suite itself and so Ill try to provide all the information I can here and hopefully somebody can either spot what Im doing wrong or confirm the validity of a bug in mock itself.In order to illustrate the issue better, I setup two branches (below are links to their PRs) in my project:
lists
- my feature branch where mock is pinned to1.0.1
and all tests passmock
- branch where I pinned mock to1.1.3
which causes same tests to fail both locally and in travis.You can in open mock->lists PR that the only difference is the mock version makes me believe that mock might contain a bug.
Here are corresponding travis jobs for both branches (links to Py3 build however same happens on Py2 as well):
lists
- tests passmock
- tests failFor convenience here are relevant links to code:
Any ideas?
Let me know if you will need any additional information to debug this further.
PS. I had similar results when trying to use Python3 built-in
unittest.mock
.The text was updated successfully, but these errors were encountered: