Merge pull request #7141 from bluetech/rm-nonzero

This commit is contained in:
Bruno Oliveira 2020-05-02 10:00:35 -03:00 committed by GitHub
commit 0b78983197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -38,8 +38,6 @@ class MarkEvaluator:
# don't cache here to prevent staleness
return bool(self._get_marks())
__nonzero__ = __bool__
def wasvalid(self):
return not hasattr(self, "exc")

View File

@ -640,10 +640,10 @@ class TestAssertionRewrite:
assert getmsg(f) == "assert 5 <= 4"
def test_assert_raising_nonzero_in_comparison(self):
def test_assert_raising__bool__in_comparison(self):
def f():
class A:
def __nonzero__(self):
def __bool__(self):
raise ValueError(42)
def __lt__(self, other):