old logging cleanup
This commit is contained in:
parent
986135ff76
commit
8f6fa5e9ff
|
@ -1,7 +1,6 @@
|
|||
import uuid
|
||||
from importlib import reload
|
||||
|
||||
from sanic.config import LOGGING
|
||||
from sanic.response import text
|
||||
from sanic import Sanic
|
||||
from io import StringIO
|
||||
|
@ -38,20 +37,3 @@ def test_log():
|
|||
request, response = app.test_client.get('/')
|
||||
log_text = log_stream.getvalue()
|
||||
assert rand_string in log_text
|
||||
|
||||
|
||||
def test_default_log_fmt():
|
||||
|
||||
reset_logging()
|
||||
Sanic()
|
||||
for fmt in [h.formatter for h in logging.getLogger('sanic').handlers]:
|
||||
assert fmt._fmt == LOGGING['formatters']['simple']['format']
|
||||
|
||||
reset_logging()
|
||||
Sanic(log_config=None)
|
||||
for fmt in [h.formatter for h in logging.getLogger('sanic').handlers]:
|
||||
assert fmt._fmt == "%(asctime)s: %(levelname)s: %(message)s"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_log()
|
||||
|
|
Loading…
Reference in New Issue
Block a user