pytest arugment error

213 views
Skip to first unread message

Jae Kim

unread,
Nov 2, 2017, 8:58:33 AM11/2/17
to Ansible Project

Hi

 

Following the command in this manual

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

Toshio Kuratomi

unread,
Nov 2, 2017, 9:04:40 AM11/2/17
to ansible...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4c635a56-5e29-4744-8979-431e68af5263%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jae Kim

unread,
Nov 5, 2017, 8:10:21 PM11/5/17
to Ansible Project

Toshio Kuratomi

unread,
Nov 5, 2017, 8:14:01 PM11/5/17
to ansible...@googlegroups.com
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.



On Nov 5, 2017 5:10 PM, "Jae Kim" <jki...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.

Jae Kim

unread,
Nov 6, 2017, 7:15:06 AM11/6/17
to Ansible Project
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 =========================

   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

      

Toshio Kuratomi

unread,
Nov 9, 2017, 8:58:43 AM11/9/17
to ansible...@googlegroups.com
You need to pip install the test requirements as well.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages