fix doctest calling configLogger causing flakiness of other tests
since we use pytest-randomly to randomize the test execution, depending on when this specific test is executed, it may have the side effect of configuring the global logging configuration, causing other tests that capture logging messages to fail. E.g. see https://travis-ci.org/fonttools/fonttools/jobs/545680550
This commit is contained in:
parent
1fc1d2f529
commit
160a9cb238
@ -250,8 +250,8 @@ class Timer(object):
|
|||||||
upon exiting the with-statement.
|
upon exiting the with-statement.
|
||||||
|
|
||||||
>>> import logging
|
>>> import logging
|
||||||
>>> log = logging.getLogger("fontTools")
|
>>> log = logging.getLogger("my-fancy-timer-logger")
|
||||||
>>> configLogger(level="DEBUG", format="%(message)s", stream=sys.stdout)
|
>>> configLogger(logger=log, level="DEBUG", format="%(message)s", stream=sys.stdout)
|
||||||
>>> with Timer(log, 'do something'):
|
>>> with Timer(log, 'do something'):
|
||||||
... time.sleep(0.01)
|
... time.sleep(0.01)
|
||||||
Took ... to do something
|
Took ... to do something
|
||||||
|
Loading…
x
Reference in New Issue
Block a user