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
Replace global is_peekable with a check on every file #108
Conversation
Codecov Report
@@ Coverage Diff @@
## master #108 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 576 573 -3
=====================================
- Hits 576 573 -3
Continue to review full report at Codecov.
|
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.
Overall, the idea behind the fix looks good, but I think it's possible that this is trading one AttributeError
for another one. I think this might be subtly wrong and indicative that the test suite doesn't have adequate coverage.
Since peekable
is from more_itertools
, this is going to fail with an AttributeError
when more_itertools
is not installed. By default, tappy does not install more_itertools
without using tap.py[yaml]
as the package to install.
Maybe an ENABLE_VERSION_13
if clause is needed somewhere in here.
Good point about I don't have any idea how to improve test coverage of this, if it's required for acceptance of this PR. Do you have some pointers to get me in the right direction? |
Great question! I think the way we can check on this is with diff --git a/tox.ini b/tox.ini
index 72d5060..79a37cf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,8 +11,12 @@ envlist =
[testenv]
deps =
+ coverage
pytest
-commands = pytest {envsitepackagesdir}/tap
+commands =
+ # pytest {envsitepackagesdir}/tap
+ coverage run tap/tests/run.py
+ coverage report -m --include "*/tap/*" --omit "*/tests/*"
+ coverage html
[testenv:windows]
basepython = python3.6 Once that is complete, you can open If that's the case, then a new test could be added to reach that line of code. I suspect that it will hit the |
Thanks for the hints, and sorry for the delay. I have now committed a test case that throws an |
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.
Thanks for taking the time to write this extra test. I'm glad you were able to prove that master would throw an AttributeError
. This looks good to me. 👍
Fixes #107
To accept your contribution, please ensure that the checklist below is complete.