From 693726844455183ce5cc263c60c26fd762a272bc Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 14 Nov 2018 17:41:15 -0800 Subject: [PATCH] [stable-2.6] Fix unit test issues with pytest >= 4.0.0. (cherry picked from commit feb5b0b299054af6df0754b4ca441859bec1ac11) Co-authored-by: Matt Clay --- test/units/module_utils/basic/test_argument_spec.py | 4 ++-- test/units/modules/packaging/os/conftest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/units/module_utils/basic/test_argument_spec.py b/test/units/module_utils/basic/test_argument_spec.py index 18ccd845e9..7dddbb3640 100644 --- a/test/units/module_utils/basic/test_argument_spec.py +++ b/test/units/module_utils/basic/test_argument_spec.py @@ -130,9 +130,9 @@ def options_argspec_list(): @pytest.fixture -def options_argspec_dict(): +def options_argspec_dict(options_argspec_list): # should test ok, for options in dict format. - kwargs = options_argspec_list() + kwargs = options_argspec_list kwargs['argument_spec']['foobar']['type'] = 'dict' return kwargs diff --git a/test/units/modules/packaging/os/conftest.py b/test/units/modules/packaging/os/conftest.py index 84742fbb61..f9c464512d 100644 --- a/test/units/modules/packaging/os/conftest.py +++ b/test/units/modules/packaging/os/conftest.py @@ -10,7 +10,7 @@ def get_method_name(request_body): @pytest.fixture def mock_request(request, mocker): - responses = request.getfuncargvalue('testcase')['calls'] + responses = request.getfixturevalue('testcase')['calls'] module_name = request.module.TESTED_MODULE def transport_request(host, handler, request_body, verbose=0):