-
Notifications
You must be signed in to change notification settings - Fork 14
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
Tests: first pass at improving coverage #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some really nice improvements here.
Thanks. I implemented all the changes requested in the pre-review, coverage is back to 72%. Although there's more work to do, this PR is fairly large and ready for actual review and merge. It's also OK for it to wait until the other large PRs in the pipeline are in. |
#42 is merged. Sorry for the messy rebase. |
Rebased again, fixed all conflicts, ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much ready. Loving the new coverage too, and you've already found a bug.
- added a .coveragerc config file; - changed a number of exceptions to classes ignored in the config file; - added and extended several tests; - various small improvements.
- more Exceptions converted into AssertionErrors; - added more tests.
This is a first pass at improving test coverage. Part of #38.
I added a
.coveragerc
config file which, among other things, excludes the test files themselves from coverage. This brought the overall coverage down from a theoretical 74% to a more realistic 70%.It also excludes lines raising several errors:
AssertionError
,NotImplementedError
,CrazyKeyError
andParameterRangeError
. I then changed a number of exceptions toAssertionError
andNotImplementedError
, let me know if this approach makes sense.I manually excluded some minor methods from coverage with the
nocover
comment.I also added and extended several tests, which also increased coverage. It currently stands at 71%.
Here is the command I'm using (it needs the
pytest-cov
plugin), run from the directory above the repo:UPDATE 1: more
Exception
s converted intoAssertionError
s, added more tests. Coverage is now at 72%.UPDATE 2: split
test_pydecred.py
intotest_calc.py
,text_txscript.py
andtest_vsp.py
.text_txscript.py
is quite large already, no reason to group unrelated tests with it.UPDATE 3: replaced all
Unimplemented
errors inwallet/api.py
with the built-inNotImplementedError
, and removed theUnimplemented
class itself. Coverage is now at 73%.