Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
spumer committed Jun 20, 2017
2 parents 3121992 + e8ab91a commit b38366d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
10 changes: 0 additions & 10 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,16 +729,6 @@ def test_nested_dataerror_value(self):
{0: "Wait for good value, got 'BAD ONE'"}
)

def test_dataerror_as_boolean(self):
error = t.DataError('error')
self.assertEqual(bool(error), False)
self.assertEqual(error or 2, 2)

def test_dataerror_and_catch(self):
trafaret = t.Int()
val = t.catch(trafaret, 'a') or 100
self.assertEqual(val, 100)


# res = @guard(a=String, b=Int, c=String)
# def fn(a, b, c="default"):
Expand Down
8 changes: 1 addition & 7 deletions trafaret/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .lib import py3, py3metafix


__VERSION__ = (0, 10, 0)
__VERSION__ = (0, 10, 2)


# Python3 support
Expand Down Expand Up @@ -76,12 +76,6 @@ def __str__(self):
def __repr__(self):
return 'DataError(%s)' % str(self)

def __bool__(self):
return False

def __nonzero__(self):
return False

def as_dict(self, value=False):
def as_dict(dataerror):
if not isinstance(dataerror.error, dict):
Expand Down

0 comments on commit b38366d

Please sign in to comment.