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
Patch for Additional Test Coverage for urllib.error #61673
Comments
Adding test to get 100% coverage in urllib.error. |
Thanks Daniel. I will commit it. |
New changeset 33f02ccb5301 by Senthil Kumaran in branch '3.2': New changeset 4e59a7fc69c6 by Senthil Kumaran in branch '3.3': New changeset 21d23fda469f by Senthil Kumaran in branch 'default': |
Daniel - I could not really get the need for this check. + >>> msg = str(err)
+ >>> str(err.code) in msg and err.msg in msg The other one was really useful and probably covered the reasonstr. Thanks for the patch. |
Senthil, The two lines you excluded from that patch give us coverage on HTTPError.__str__ , I added to the existing interface test so as not to re-produce the code there. I still think it could be added since it will give us that last line of coverage and verifies the exception's code and msg are in the string representation of HTTPError. root@d1:/root/hg/cpython# ./python ../coveragepy report --show-missingName Stmts Miss Cover Missing |
Daniel, Agree to your point. Sorry that i did not run the coverage before. I would prefer to do the check this way for readability of the test code and get to 100% coverage.
Any thoughts? |
Sure, your way is much easier to tell what is getting tested. The only thing I was trying to avoid is including the static text "HTTP Error" so the test will not break if that static text changes. That said, I really doubt the text would change for any reason. I think we should go with your way. |
Avoiding the static test is actually a good idea for Exception "messages", as there is no guarantee for those to be consistent across revs. But this one is slightly different in HTTPError str represent and we better be consistent in this. I dont see changing too. Thanks for bringing this to 100% coverage. |
New changeset ae9aea1b3546 by Senthil Kumaran in branch '3.2': New changeset 8e9cf147fbca by Senthil Kumaran in branch '3.3': New changeset 64183c2aa05e by Senthil Kumaran in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: