Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addi support to free functions #1081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jdiego
Copy link

@jdiego jdiego commented Dec 15, 2020

Better reports

@@ -9,12 +9,13 @@
import sys
import time
import xml.dom.minidom

import numpy as np

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this will add a dependency on numpy to coverage. Is that really necessary for improved reporting?

And it seems like the changes break the test environment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my fault. Excuse-me. I will remove it.

Copy link
Author

@jdiego jdiego Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nedbat I noticed that py coverage doesn't assign the methods to their classes. So, I made some modifications to generate the following output:

			<classes>
				<class name="Department" filename="tested_module/company_model.py" complexity="0" class_lines="23" class_hits="18" line-rate="0.7826">
					<method name="__init__" method_lines="4" method_hits="4" method_misses="0">
						<line number="4" hits="1"/>
						<line number="5" hits="1"/>
						<line number="6" hits="1"/>
						<line number="7" hits="1"/>
					</method>
					<method name="__str__" method_lines="1" method_hits="0" method_misses="1">
						<line number="10" hits="0"/>
					</method>
					<method name="add_member" method_lines="2" method_hits="2" method_misses="0">
						<line number="13" hits="1"/>
						<line number="14" hits="1"/>
					</method>
					<method name="remove_member" method_lines="1" method_hits="0" method_misses="1">
						<line number="17" hits="0"/>
					</method>
					<method name="count" method_lines="1" method_hits="1" method_misses="0">
						<line number="21" hits="1"/>
					</method>
					<method name="__len__" method_lines="1" method_hits="0" method_misses="1">
						<line number="24" hits="0"/>
					</method>
				</class>
				<class name="CompanyModel" filename="tested_module/company_model.py" complexity="0" class_lines="22" class_hits="17" line-rate="0.7727">
					<method name="__init__" method_lines="3" method_hits="3" method_misses="0">
						<line number="29" hits="1"/>
						<line number="30" hits="1"/>
						<line number="31" hits="1"/>
					</method>
					<method name="__str__" method_lines="1" method_hits="0" method_misses="1">
						<line number="34" hits="0"/>
					</method>
					<method name="add_user" method_lines="6" method_hits="5" method_misses="1">
						<line number="37" hits="1"/>
						<line number="38" hits="1"/>
						<line number="39" hits="1"/>
						<line number="40" hits="1"/>
						<line number="41" hits="1"/>
						<line number="42" hits="0"/>
					</method>
					<method name="count_persons_per_department" method_lines="1" method_hits="1" method_misses="0">
						<line number="45" hits="1"/>
					</method>
					<method name="get_headcount_for" method_lines="1" method_hits="1" method_misses="0">
						<line number="48" hits="1"/>
					</method>
				</class>
			</classes>
		</package>
	</packages>

Copy link
Author

@jdiego jdiego Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nedbat You are right. I didn't commit the modification on the test suite. I will make it again, because I had some issues with my computer. I thought that this merge commit was complete, but I was wrong about that. Again, sorry about this noob action.

@nedbat
Copy link
Owner

nedbat commented Dec 19, 2020

@jdiego Thanks for the pull request. Could you explain how it makes the reports better? And it seems like there will be some needed clean up if we're going to merge this,

@ProsperousHeart
Copy link
Contributor

Due to length of age, is this something that can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants