diff --git a/docs/docsite/rst/dev_guide/developing_modules_general.rst b/docs/docsite/rst/dev_guide/developing_modules_general.rst index 9a7823bf03..c7617c0988 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general.rst @@ -211,7 +211,7 @@ If you module does not need to target a remote host, you can quickly and easily development) activate it: ``$ . venv/bin/activate`` - Setup the environment for development: ``$ . hacking/env-setup`` - Run your test module locally and directly: - ``$ python ./my_new_test_module.py /tmp/args.json`` + ``$ python -m ansible.modules.cloud.azure.my_new_test_module /tmp/args.json`` This should return output something like this: diff --git a/test/integration/targets/test_infra/runme.sh b/test/integration/targets/test_infra/runme.sh index be3809f95b..caa33fff3b 100755 --- a/test/integration/targets/test_infra/runme.sh +++ b/test/integration/targets/test_infra/runme.sh @@ -25,3 +25,6 @@ echo "$PB_OUT" | grep -F "assert works (True)" || exit 1 # ensure test-module script works well PING_MODULE_PATH="$(pwd)/../../../../lib/ansible/modules/system/ping.py" ../../../../hacking/test-module -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)" + +# ensure exercising module code locally works +python -m ansible.modules.files.file <<< '{"ANSIBLE_MODULE_ARGS": {"path": "/path/to/file", "state": "absent"}}'