Tests failing due to mock 3.0.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ec2-api |
Fix Released
|
Undecided
|
Stephen Finucane |
Bug Description
Two of the unit tests are currently failing on all branches:
$ tox -e py27
...
===
Failed 2 tests - output below:
===
ec2api.
---
Captured traceback:
~~~
Traceback (most recent call last):
File "/home/
return func(*args, **keywargs)
File "ec2api/
File "ec2api/
File "/home/
File "/home/
raise mismatch_error
ec2api.
---
Captured traceback:
~~~
Traceback (most recent call last):
File "/home/
return func(*args, **keywargs)
File "ec2api/
File "ec2api/
File "/home/
File "/home/
raise mismatch_error
...
This appears to be because of a change in behavior in mock 3.x. Manually downgrading to mock 2.0.0 in the py27 venv resolves this issue.
Changed in ec2-api: | |
status: | New → Confirmed |
assignee: | nobody → Stephen Finucane (stephenfinucane) |
Changed in ec2-api: | |
status: | Confirmed → In Progress |
Reviewed: https:/ /review. opendev. org/663651 /git.openstack. org/cgit/ openstack/ ec2-api/ commit/ ?id=7b7c2d9f213 d6c147b81e0a62e c0bdd907721080
Committed: https:/
Submitter: Zuul
Branch: master
commit 7b7c2d9f213d6c1 47b81e0a62ec0bd d907721080
Author: Stephen Finucane <email address hidden>
Date: Thu Jun 6 11:15:45 2019 +0100
tests: Avoid using mock wraps
It looks like something has changed in mock 3.x, resulting in some
functions that are wrapped by mock not being called or being called
incorrectly. This breaks some of the assertions we have. There is almost
certainly a bug (or is it a feature, who knows) but the fact is these
tests were extremely tightly coupled to the implementation and probably
didn't need to be. Stop attempting to spy on them and resolve the issue.
We also start using 'assert_not_called' since that's available in mock
3.x.
Change-Id: I06dddc4eba36f8 0398732ab4f2b7c bc4d7717a00
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1831870