Closed PiDelport closed 8 years ago
I've heard that the mocks don't really work with Python 3.5 (see this conversation) - I've been meaning to look deeper into this, I can't remember what the issue is exactly. And I'll be frank - mocking is still a bit of a mystery to me, I could have just been mocking incorrectly this whole time. I did find it difficult to have mocks for both with and without requests
installed.
I'd be okay if you want to put in some skipif statements where mock fails just to see if the rest of the code works with 3.5 (and continue to add to the technical debt for me to check up on when I can :D)
I think those tests are actually failing due to the problem described in this article:
"assert_called_once: Threat or Menace" (Tyler Roscoe)
In short, assert_called_once()
is not a valid assertion method, so the mock object treats it as a mocked method instead, and silently does nothing!
The right method to use instead is assert_called_once_with()
.
Python 3.5 and the newer mock library has a heuristic check which detects this, which what the Python3.5 build now fails with.
I started a branch to fix this problem.
@pjdelport you're awesome!
Okay, once #89 is merged, this should pass as well. :)
@econchick: The way attrs does it is nice!
Merging this on mobile 😜 here's hoping this works!
This adds Python 3.5 to the list of tested and supported environments.