py test logging for tests that pass

0 votes
I have been over and over the documentation, but I can not fine out how I get py.test to write to the log for tests that pass. For example if I run "py.test --resultlog=mylog.txt myPytest.py" mylog.txt only has one line for each test that passed. I want to add other things to each test recorded in my log file, regardless whether thy passed or failed. For example I need to know the time they ran, some of the output data etc. How do I get py.test to include data about the test (passed and failed) in the py.test log file?
Apr 2, 2019 in Python by ana1504.k
• 7,910 points
3,724 views

1 answer to this question.

0 votes
you could use py-cov combine with pytest

py.test --cov $(MOD_NAME) --cov-config .coveragerc --cov-report xml --junit-xml=results.xml
answered Apr 2, 2019 by SDeb
• 13,300 points

Related Questions In Python

+1 vote
1 answer

How to use GUI that comes with Python to test your code?

Hey @alex0809, When your testing a website ...READ MORE

answered Sep 24, 2018 in Python by Vardhan
• 13,150 points
945 views
0 votes
1 answer

In python how to test a string for a substring

if "ABCD" in "xxxxABCDyyyy": This can be used ...READ MORE

answered Oct 24, 2018 in Python by Priyaj
• 58,020 points
787 views
0 votes
1 answer

How should I write tests for Forms in Django with Python?

from django.tests import TestCase class MyTests(TestCase): ...READ MORE

answered Nov 20, 2018 in Python by Nymeria
• 3,560 points
1,419 views
0 votes
0 answers

Is there any module in Python that I can use for Wiki markup?

Hi all, simple question. Is there any ...READ MORE

Jan 22, 2019 in Python by Anirudh
• 2,090 points
612 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
0 votes
1 answer

How to get travis to fail if tests do not have enough coverage for python?

if you add the --fail-under switch to ...READ MORE

answered May 10, 2019 in Python by SDeb
• 13,300 points
1,118 views
0 votes
1 answer

Return a list inside a for loop while iterating over the elements of another list

The print() is getting called multiple times ...READ MORE

answered Sep 22, 2018 in Python by SDeb
• 13,300 points
5,034 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP