Add set.{__iter__,__ior__,__iand__,__isub__,__ixor__}#524
Add set.{__iter__,__ior__,__iand__,__isub__,__ixor__}#524windelbouwman merged 2 commits intoRustPython:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #524 +/- ##
==========================================
+ Coverage 50.34% 50.44% +0.09%
==========================================
Files 68 68
Lines 13868 13893 +25
Branches 3436 3441 +5
==========================================
+ Hits 6982 7008 +26
+ Misses 5035 5029 -6
- Partials 1851 1856 +5
Continue to review full report at Codecov.
|
| except TypeError: | ||
| pass | ||
| else: | ||
| assert False, "TypeError not raised" |
There was a problem hiding this comment.
Could you use the assert_raises function for these checks? Just makes these a bit less verbose
There was a problem hiding this comment.
You cant do assignment inside lambda function so the best I can think about is something like this:
a = [set([1,2,3])]
def f():
a[0] |= set([4,5])
assert_raises(TypeError, f)I believe the current option is more clear. Any other suggestion?
There was a problem hiding this comment.
Oh, I completely missed that it's an assignment! Hopefully in the future we'll have something like assertRaises from unittest:
with self.assertRaises(TypeError):
a[0] |= set([4,5])There was a problem hiding this comment.
The with statement should work, so we could do the same now by implementing a contextmanager.
No description provided.