Fix @contextmanager leak on exception. (#21031)

* Fix @contextmanager leak on exception.
* Fix test leaks of global module args cache.
This commit is contained in:
Matt Clay 2017-02-03 17:19:59 -08:00 committed by GitHub
parent bb9ee0cf6f
commit 272ff10fa1
4 changed files with 25 additions and 13 deletions

View file

@ -721,6 +721,7 @@ def test_distribution_version():
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={}))
with swap_stdin_and_argv(stdin_data=args):
basic._ANSIBLE_ARGS = None
module = basic.AnsibleModule(argument_spec=dict())
for t in TESTSETS: