Skip to content

Instantly share code, notes, and snippets.

@mplanchard
Created November 28, 2017 22:02
Show Gist options
  • Save mplanchard/c68a1a45a5bfca875fe141cc0e814d38 to your computer and use it in GitHub Desktop.
Save mplanchard/c68a1a45a5bfca875fe141cc0e814d38 to your computer and use it in GitHub Desktop.
PyTest memory utilization test
from logging import basicConfig, getLogger
import pytest
basicConfig()
log = getLogger()
log.setLevel('DEBUG')
def func_that_logs_a_lot():
for i in range(1000):
log.info('foo output %s/1000', i)
def test_func_that_logs_a_lot():
for _ in range(1000):
output = func_that_logs_a_lot()
log.info('got output: %s', output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment