Feature: improve branch coverage#6036
Conversation
feat: issue #2 improves code coverage for insert_repair() from 88% to…
…en it shouldn't
Write 3 additional tests
feat: issue #4 reduces CCN of insert_repair() by 65%
feat: issue #8 adds coverage htmls to showcase improvement
fix: added docstring test for from_sequence
fix: removed code from main to doctest
fix: added unit tests for is_palindrome.py
…moved non-useful htmls)
Increase test coverage of data_structures/binary_tree/red_black_tree.py to 92%
Also wrap the function, so the function can be triggered by parameters instead of input().
Now, if using the command "coverage run -m closest_pair_of_points", we get coverage of 100%. Meanwhile, if using the command "coverage run -m pytest --doctest-modules closest_pair_of_points.py", we get coverage of 95%.
fix: issue #10 adjust documentation according to contribution guidelines
Adds the last (imo) reasonable test
| rotations necessary to maintain balance, and then returns the | ||
| new root to this subtree (likely self). | ||
| This is guaranteed to run in O(log(n)) time. | ||
|
|
|
|
||
|
|
||
| >>> epq2 = ElementPriorityQueue() | ||
| >>> q = [[epq2.enqueue(11)] for _ in range(101)] | ||
| Traceback (most recent call last): | ||
| ... | ||
| priority_queue_using_list.OverFlowError: Maximum queue size is 100 |
There was a problem hiding this comment.
FAILED data_structures/queue/priority_queue_using_list.py::data_structures.queue.priority_queue_using_list.ElementPriorityQueue
| >>> fpq = FixedPriorityQueue() | ||
| >>> fpq.enqueue(3, 10) | ||
| Traceback (most recent call last): | ||
| ... | ||
| ValueError: Valid priorities are 0, 1, and 2 | ||
| >>> fpq = FixedPriorityQueue() | ||
| >>> q = [fpq.enqueue(0,5) for _ in range(101)] | ||
| Traceback (most recent call last): | ||
| ... | ||
| OverflowError: Maximum queue size is 100 | ||
|
|
There was a problem hiding this comment.
FAILED data_structures/queue/priority_queue_using_list.py::data_structures.queue.priority_queue_using_list.FixedPriorityQueue
|
Please fix the build checks. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
| import re | ||
| from random import random | ||
|
|
||
| __all__ = ("re",) |
| >>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2 | ||
| 2 | ||
| >>> hashTable = DoubleHash(5) | ||
| >>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1 | ||
| 1 |
There was a problem hiding this comment.
| >>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2 | |
| 2 | |
| >>> hashTable = DoubleHash(5) | |
| >>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1 | |
| 1 | |
| >>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2 | |
| 2 | |
| >>> hashTable = DoubleHash(5) | |
| >>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1 | |
| 1 |
|
All checks fail? |
|
Nice work. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Let's fix the tests? - this would be great to have |
|
I agree! I will not have time unfortunately :(. But there are two tests that are failing according to the report. |
|
Yes, but maintainers do not have the edit permission, so if you could please fix those 2 issues |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
In preparation for that denial-of-service attack that is Hacktoberfest, I am closing all pull requests that have failing tests. |
Describe your change:
closes #6020
Please see issue:
Checklist:
Fixes: #{$ISSUE_NO}.