fix logging config and add profiler test (#1267)

This commit is contained in:
Jeremy Jordan 2020-03-29 14:56:36 -04:00 committed by GitHub
parent dab3b965cb
commit 54507f417e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -10,9 +10,10 @@ __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
__docs__ = "PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers." \
" Scale your models. Write less boilerplate."
from logging import getLogger
import logging as python_logging
_logger = getLogger("lightning")
_logger = python_logging.getLogger("lightning")
python_logging.basicConfig(level=python_logging.INFO)
try:
# This variable is injected in the __builtins__ by the build

View File

@ -74,10 +74,12 @@ def test_simple_profiler_overhead(simple_profiler, n_iter=5):
assert all(durations < PROFILER_OVERHEAD_MAX_TOLERANCE)
def test_simple_profiler_describe(simple_profiler):
def test_simple_profiler_describe(caplog, simple_profiler):
"""Ensure the profiler won't fail when reporting the summary."""
simple_profiler.describe()
assert "Profiler Report" in caplog.text
def test_simple_profiler_value_errors(simple_profiler):
"""Ensure errors are raised where expected."""