# Recommended way to run core module tests in Travis?

**URL:** <https://forum.ansible.com/t/recommended-way-to-run-core-module-tests-in-travis/21728>\
**Category:** Ansible Project\
**Created:** [June 9, 2016, 10:45pm UTC](https://forum.ansible.com/t/recommended-way-to-run-core-module-tests-in-travis/21728 "2016-06-09T22:45:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Maglana](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Mark\_Maglana](https://forum.ansible.com/u/Mark_Maglana)\
**Post date:** [June 9, 2016, 10:45pm UTC](https://forum.ansible.com/t/recommended-way-to-run-core-module-tests-in-travis/21728/1 "2016-06-09T22:45:15Z")

</div>

I’m learning how to write modules that I’d like to eventually submit to this repo. In the meantime, I’m working on it from my fork. I’m writing unit tests alongside my module under the test directory and would like for these tests to run in Travis. I tried adding the following lines to the bottom of the `script` section of `.travis.yml`

```auto
- pip install -r test-requirements.txt
- py.test --random -v test

```

However, the build fails because the the environment is not setup properly: [https://travis-ci.org/relaxdiego/ansible-modules-core/builds/136561867](https://travis-ci.org/relaxdiego/ansible-modules-core/builds/136561867)

I’m about to try other stuff to make this work but was also wondering if I just missed some developer documentation somewhere which is why I’m filing this ticket. Is there a best practice for running my unit tests with the build?

---

<div class="post-metadata">

**Author:** ![Mark\_Maglana](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Mark\_Maglana](https://forum.ansible.com/u/Mark_Maglana)\
**Post date:** [June 10, 2016, 3:54pm UTC](https://forum.ansible.com/t/recommended-way-to-run-core-module-tests-in-travis/21728/2 "2016-06-10T15:54:25Z")

</div>

Replying to my own question:

I submitted a PR for this: [https://github.com/ansible/ansible-modules-core/pull/3909](https://github.com/ansible/ansible-modules-core/pull/3909)
