Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Jul 12, 2024
1 parent 996fc8c commit d427f9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion moler/util/converterhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def to_number(self, value, raise_exception: bool = True, none_if_cannot_convert:
if raise_exception:
raise ex
if none_if_cannot_convert:
return None
ret_val = None
return ret_val

@staticmethod
Expand Down
3 changes: 3 additions & 0 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def test_converterhelper_number_wrong_format():
converter.to_number(value="abc", raise_exception=True)
val = converter.to_number(value="abc", raise_exception=False)
assert val == 0
val2 = converter.to_number(value="abc", raise_exception=False,
none_if_cannot_convert=True)
assert val2 is None


def test_converterhelper_number():
Expand Down

0 comments on commit d427f9f

Please sign in to comment.