diff options
author | Rick Elrod <rick@elrod.me> | 2020-01-26 10:16:16 +0100 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2020-01-29 22:29:40 +0100 |
commit | e2a57414f4008fe3092c231b8f39b1adefc1c16f (patch) | |
tree | 474e07870facffe55b2a96346e5357d85460d860 /test/integration/targets/elb_application_lb/aliases | |
parent | Forbid `state=(list|info)` in modules via ansible-test sanity check (diff) | |
download | ansible-e2a57414f4008fe3092c231b8f39b1adefc1c16f.tar.xz ansible-e2a57414f4008fe3092c231b8f39b1adefc1c16f.zip |
Remove `with` statement for pytest-mock unit tests
As per:
https://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager
pytest-mock is not meant to be used within a `with` context or as a
decorator. Instead, pytest-mock will automatically unpatch the mocked
methods when each test is complete.
In newer pytest-mock, this use actually throws an exception and causes
the tests to fail.
This hasn't been hit in Ansible's CI yet, because the docker image
that the tests run in uses an older version of pytest-mock. However,
there is no constraint on the upper bound of pytest-mock in
test/lib/ansible_test/_data/requirements/constraints.txt which means
that when running the tests locally, outside of that docker image, the
tests never pass.
This patch removes the `with` context in each such case.
Signed-off-by: Rick Elrod <rick@elrod.me>
Diffstat (limited to 'test/integration/targets/elb_application_lb/aliases')
0 files changed, 0 insertions, 0 deletions