# pytest arugment error

**URL:** <https://forum.ansible.com/t/pytest-arugment-error/25899>\
**Category:** Ansible Project\
**Created:** [November 2, 2017, 12:58pm UTC](https://forum.ansible.com/t/pytest-arugment-error/25899 "2017-11-02T12:58:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jae\_Kim](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jae\_Kim](https://forum.ansible.com/u/Jae_Kim)\
**Post date:** [November 2, 2017, 12:58pm UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/1 "2017-11-02T12:58:33Z")

</div>

Hi

Following the command in this manual

[http://docs.ansible.com/ansible/latest/dev\_guide/developing\_modules\_general.html](http://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html)

When I run the following command

pytest -r a --cov=. --cov-report=html --fulltrace --color yes test/units/modules/…/test/my\_new\_test\_module.py

the follow error message comes out.

pytest: error: unrecognized arguments: --cov=. --cov-report=html

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [November 2, 2017, 1:04pm UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/2 "2017-11-02T13:04:17Z")

</div>

Could you go through your shells’ history and reporter precisely which steps from that page you have performed? It looks like you’ve missed a step or two.

---

<div class="post-metadata">

**Author:** ![Jae\_Kim](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jae\_Kim](https://forum.ansible.com/u/Jae_Kim)\
**Post date:** [November 6, 2017, 1:10am UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/3 "2017-11-06T01:10:21Z")

</div>

It is a single step.  
I was following instructions from [http://docs.ansible.com/ansible/latest/dev\_guide/developing\_modules\_general.html#unit-testing](http://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#unit-testing)

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [November 6, 2017, 1:13am UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/4 "2017-11-06T01:13:47Z")

</div>

You need to follow the other steps in that page to install the test dependencies, then. Just running the single pytest step won’t set up the environment to run the tests.

---

<div class="post-metadata">

**Author:** ![Jae\_Kim](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jae\_Kim](https://forum.ansible.com/u/Jae_Kim)\
**Post date:** [November 6, 2017, 12:15pm UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/5 "2017-11-06T12:15:05Z")

</div>

> > I had executed

> > `. hacking/env-setup`

And then I executed  
pytest -r a --fulltrace --color yes ./mymoduletest/my\_new\_test\_module.py  
============================= test session starts ==============================  
platform linux – Python 3.4.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0  
rootdir: /root/work, inifile:  
collected 0 items

========================= no tests ran in 0.01 seconds =========================e

But when I execute  
pytest -r a --cov=. --cov-report=html --fulltrace --color yes ./mymoduletest/my\_new\_test\_module.py  
I get  
pytest: error: unregnoized arguements: --cov=. --cov-report=html  
infile: None  
rootdir: /root/work

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [November 9, 2017, 1:58pm UTC](https://forum.ansible.com/t/pytest-arugment-error/25899/6 "2017-11-09T13:58:29Z")

</div>

You need to pip install the test requirements as well.
