Skip to content

Commit

Permalink
Update parameters for mock logged assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Oct 16, 2024
1 parent d0462e9 commit 45bc18a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ipwb/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def exception_logger(catch=True, exception_class=Exception):
"""
Decorator which catches exceptions in the function and logs them.
Decorator that catches exceptions in the function and logs them.
Usage:
Expand All @@ -17,11 +17,11 @@ def decorated_function(foo, bar):
do_something
```
`exception_logger()` will catch any exception which happens in
`exception_logger()` will catch any exception that happens in
`decorated_function()` while it is being executed, and log an error using
Python built in `logging` library.
Unless `catch` argument is `False` - in which case the exception will be
Unless `catch` argument is `False` - in which case, the exception will be
reraised.
"""
def decorator(f: Callable):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def test_catch():
with patch('ipwb.error_handler.logger.critical', mock_logger):
caught_error('boo')

assert mock_logger.assert_called_once_with('boo')
assert mock_logger.assert_called_once_with('*','boo')

0 comments on commit 45bc18a

Please sign in to comment.