Remove a couple Python 2 __nonzero__ definitions

It's called __bool__ in Python 3.
This commit is contained in:
Ran Benita 2020-05-01 11:39:38 +03:00
parent be68496440
commit 409ffcef17
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):