mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-02 01:03:28 +02:00
Add unit tests, fix bug
This commit is contained in:
parent
089763c578
commit
d14dbd082d
3 changed files with 105 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue