ansible/test/units/plugins/lookup
Rick Elrod e2a57414f4 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>
2020-01-29 13:29:40 -08:00
..
fixtures Adding Avi ansible lookup module (#58667) 2019-07-24 11:35:04 -04:00
__init__.py
test_avi.py Adding Avi ansible lookup module (#58667) 2019-07-24 11:35:04 -04:00
test_aws_secret.py Remove with statement for pytest-mock unit tests 2020-01-29 13:29:40 -08:00
test_aws_ssm.py Remove with statement for pytest-mock unit tests 2020-01-29 13:29:40 -08:00
test_conjur_variable.py Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
test_env.py Fix env lookup plugin error on utf8 values (#65541) 2019-12-25 17:24:38 +05:30
test_ini.py Remove empty setUp/tearDown/tearDownClass methods in test classes. 2019-11-06 08:14:29 -08:00
test_laps_password.py missing_required_lib: add information how to change Python interpreter (#60736) 2019-08-20 19:44:38 +10:00
test_lastpass.py Remove empty setUp/tearDown/tearDownClass methods in test classes. 2019-11-06 08:14:29 -08:00
test_manifold.py New lookup module: manifold (#50435) 2019-03-27 07:20:15 -04:00
test_onepassword.py Fix onepassword lookup plugin and onepassword_facts module when a field has no name. (#58308) 2019-06-28 12:37:14 -04:00
test_password.py Replace TestCase.assertEquals with TestCase.assertEqual. 2019-11-11 10:24:21 -08:00