{"body":"Unit tests\n----------\n\nYou can add unit tests for your module in ``./test/units/modules``. You can run these in a container as well. First, set up your development environment:\n\n``. hacking/env-setup``\n\nThen run the tests you want to run in the container of your choice:\n\n``ansible-test --docker default units MODULE_NAME``\n``ansible-test --venv units MODULE_NAME``\n\nAnsible uses pytest for unit testing. You can run pytest against a single test module (provide the path to the test module appropriately):\n\n``$ pytest -r a --cov=. --cov-report=html --fulltrace --color yes\ntest/units/modules/.../test/my_test.py``\n","name":"Second revised edition for PR 62314","extension":"txt","url":"https://www.irccloud.com/pastebin/0UbWC4dd/Second+revised+edition+for+PR+62314","modified":1573758745,"id":"0UbWC4dd","size":614,"lines":16,"own_paste":false,"theme":"","date":1573758745}