# ansible-test and testing locally before commit

**URL:** <https://forum.ansible.com/t/ansible-test-and-testing-locally-before-commit/33201>\
**Category:** Ansible Developer\
**Tags:** aws\
**Created:** [June 17, 2020, 2:54pm UTC](https://forum.ansible.com/t/ansible-test-and-testing-locally-before-commit/33201 "2020-06-17T14:54:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sydo\_Luciani](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Sydo\_Luciani](https://forum.ansible.com/u/Sydo_Luciani)\
**Post date:** [June 17, 2020, 2:54pm UTC](https://forum.ansible.com/t/ansible-test-and-testing-locally-before-commit/33201/1 "2020-06-17T14:54:47Z")

</div>

Getting error running ansible-test against the existing modules in either community.aws or amazon.aws:

ansible-test sanity --test yamllint route53\_zone.py  
ERROR: Target pattern not matched: route53\_zone.py

any idea why ?

Is there an Ansible how to document to setup local test environment like using pre-commit, black, flake8 to automate the test procedure locally before push or commit ?

Thanks

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 17, 2020, 2:57pm UTC](https://forum.ansible.com/t/ansible-test-and-testing-locally-before-commit/33201/2 "2020-06-17T14:57:20Z")

</div>

You need to use the path to that file, not just the basename. If you install the python argcomplete package, you can tab complete the targets in ansible-test
