From 264892c7684f20df15f42ffefcdb6113bdc10b8b Mon Sep 17 00:00:00 2001 From: wim glenn Date: Thu, 16 Jul 2020 11:34:30 -0500 Subject: [PATCH] reset defaults in case user code has already configured structlog at import time --- .travis.yml | 9 ++------- pytest_structlog.py | 3 ++- setup.py | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b4972e..16af9f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,20 +4,15 @@ sudo: false python: - "2.7" - - "3.5" - "3.6" - - "pypy" - - "pypy3.5" + - "3.7" + - "3.8" - "nightly" matrix: fast_finish: true allow_failures: - python: "nightly" - include: - - python: 3.7 - dist: xenial - sudo: true install: - pip install --upgrade pytest diff --git a/pytest_structlog.py b/pytest_structlog.py index cc7d3ce..9a65a6f 100644 --- a/pytest_structlog.py +++ b/pytest_structlog.py @@ -2,7 +2,7 @@ import structlog -__version__ = "0.2" +__version__ = "0.3" class EventList(list): @@ -73,6 +73,7 @@ def log(monkeypatch): # redirect logging to log capture cap = StructuredLogCapture() + structlog.reset_defaults() structlog.configure(processors=[cap.process]) monkeypatch.setattr("structlog.configure", no_op) monkeypatch.setattr("structlog.configure_once", no_op) diff --git a/setup.py b/setup.py index f9bfae5..7428add 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="pytest-structlog", - version="0.2", + version="0.3", url="https://github.com/wimglenn/pytest-structlog", description="Structured logging assertions", long_description=open("README.rst").read(),