Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable automatic initialization for pytest #13

Merged
merged 1 commit into from Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion log/__init__.py
Expand Up @@ -13,4 +13,4 @@
exc = exception

__project__ = 'minilog'
__version__ = '0.4'
__version__ = '0.4.1b1'
3 changes: 2 additions & 1 deletion log/utils.py
@@ -1,13 +1,14 @@
"""Implements the "magic" to create `logging` records for the caller."""

import sys
import logging
import inspect

from . import helpers


def create_logger_record(level, message, *args, exc_info=None, **kwargs):
if not helpers.initialized:
if not helpers.initialized and 'pytest' not in sys.modules:
helpers.init()

frame, filename, lineno, *_ = inspect.stack()[3]
Expand Down