-
Notifications
You must be signed in to change notification settings - Fork 3
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
Do notation style #21
Conversation
Might be useful to have a full test with |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 14 +1
Lines 962 1014 +52
=========================================
+ Hits 962 1014 +52 ☔ View full report in Codecov by Sentry. |
rusty_results/prelude.py
Outdated
:return: Self if self is Some(T) otherwise | ||
:raises: EarlyReturnException(Empty) | ||
""" | ||
... |
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.
add pragma no cover
rusty_results/prelude.py
Outdated
:return: T if self is Ok(T) otherwise | ||
:raises: EarlyReturnException(Err(e)) | ||
""" | ||
... |
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.
add pragma no cover
|
||
def test_early_return(): | ||
@early_return | ||
def __test_it() -> Option[str]: |
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 would change the __test_it function to accept a parameter and just use the ~parameter and check if it is empty or Some(10) and we get the 100% coverage back again
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.
Just added the pragma to the line that never reaches.
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.
minor things
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.
lgtm
Added a decorator and a operator for using do-notation style of unwraps as per @AlejandroCabeza idea.