# Running test-module against any module throwing FileNotFoundError

**URL:** <https://forum.ansible.com/t/running-test-module-against-any-module-throwing-filenotfounderror/29428>\
**Category:** Ansible Developer\
**Created:** [January 12, 2019, 6:49am UTC](https://forum.ansible.com/t/running-test-module-against-any-module-throwing-filenotfounderror/29428 "2019-01-12T06:49:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaak](https://avatars.discourse-cdn.com/v4/letter/i/9e8a1a/32.png) [@Isaak](https://forum.ansible.com/u/Isaak)\
**Post date:** [January 12, 2019, 6:49am UTC](https://forum.ansible.com/t/running-test-module-against-any-module-throwing-filenotfounderror/29428/1 "2019-01-12T06:49:40Z")

</div>

Hi

Running commands mentioned in test-module example throw errors:

[https://github.com/ansible/ansible/blob/devel/hacking/test-module#L26](https://github.com/ansible/ansible/blob/devel/hacking/test-module#L26)

./hacking/test-module -m lib/ansible/modules/commands/command.py -a “/bin/sleep 3”

- including generated source, if any, saving to: /home/user\_name/.ansible\_module\_generated  
Traceback (most recent call last):  
File “./hacking/test-module”, line 271, in   
main()  
File “./hacking/test-module”, line 267, in main  
runtest(modfile, argspath, modname, module\_style, interpreters)  
File “./hacking/test-module”, line 204, in runtest  
modfile, argspath = ansiballz\_setup(modfile, modname, interpreters)  
File “./hacking/test-module”, line 182, in ansiballz\_setup  
cmd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)  
File “/usr/lib64/python3.6/subprocess.py”, line 709, in **init**  
restore\_signals, start\_new\_session)  
File “/usr/lib64/python3.6/subprocess.py”, line 1344, in \_execute\_child  
raise child\_exception\_type(errno\_num, err\_msg, err\_filename)  
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/user\_name/.ansible\_module\_generated’: ‘/home/user\_name/.ansible\_module\_generated’

Here is how my environment is setup:

git clone [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)  
cd ansible  
/usr/bin/python3 -m venv venv  
source venv/bin/activate  
pip install -r requirements.txt  
source hacking/env-setup

Python 3.6.6

ansible 2.8.0.dev0

Thanks  
Isaak
