-
-
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
Add a doctest to hashes/hamming_code.py #10961
Add a doctest to hashes/hamming_code.py #10961
Conversation
I see that the build is failing with this error: =========================== short test summary info ============================ But I hadn't touched that file at all. Should I be trying to figure out what's wrong in that file? Even if I could figure it out, wouldn't that mean my pull request would touch more than one algorithm, which we're not supposed to do? |
@@ -77,6 +77,10 @@ def emitter_converter(size_par, data): | |||
|
|||
>>> emitter_converter(4, "101010111111") | |||
['1', '1', '1', '1', '0', '1', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1'] | |||
>>> emitter_converter(5, "101010111111") |
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.
Have you tried running python3 -m doctest -v hashes/hamming_code.py
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.
I did, when I run it it shows this:
1 items had no tests:
hamming_code
4 items passed all tests:
1 tests in hamming_code.emitter_converter
1 tests in hamming_code.receptor_converter
1 tests in hamming_code.text_from_bits
1 tests in hamming_code.text_to_bits
4 tests in 5 items.
4 passed and 0 failed.
Test passed.
But I see below that when you ran it there were tests failing in this file. Any guidance on what I might be doing wrong that tests are passing for me, but not when someone else is running it? Thank you for your help! This is my first attempt at an open source contribution so I truly appreciate your help navigating all of this :)
We need to check with it 2 items had failures: |
Looking at the failed If the rerun of the tests pass then let's merge this one. |
Describe your change:
Added a doctest to hashes/hamming_code.py to increase test coverage to 100%
Checklist: