Add unit tests, fix bug

This commit is contained in:
zandercymatics 2024-03-18 09:43:43 -06:00
parent 089763c578
commit d14dbd082d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 105 additions and 2 deletions

View file

@ -49,3 +49,17 @@ def less_console_noise():
handler.setStream(restore[handler.name])
# close the file we opened
devnull.close()
def less_console_noise_decorator(func):
"""
Decorator to silence console logging using the less_console_noise() function.
"""
# "Wrap" the original function in the less_console_noise with clause,
# then just return this wrapper.
def wrapper(*args, **kwargs):
with less_console_noise():
return func(*args, **kwargs)
return wrapper