Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 4, 2021
1 parent cb0ae66 commit 0806b4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/structlog/contextvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .types import EventDict, WrappedLogger


STRUCTLOG_KEY_PREFIX = 'structlog_'
STRUCTLOG_KEY_PREFIX = "structlog_"
_CONTEXT_VARS: Dict[str, contextvars.ContextVar] = {}


Expand Down Expand Up @@ -72,7 +72,7 @@ def bind_contextvars(**kw: Any) -> None:
.. versionchanged:: 20.2.0 See toplevel note
"""
for k, v in kw.items():
structlog_k = f'{STRUCTLOG_KEY_PREFIX}{k}'
structlog_k = f"{STRUCTLOG_KEY_PREFIX}{k}"
try:
var = _CONTEXT_VARS[structlog_k]
except KeyError:
Expand All @@ -93,6 +93,6 @@ def unbind_contextvars(*keys: str) -> None:
.. versionchanged:: 20.2.0 See toplevel note
"""
for k in keys:
structlog_k = f'{STRUCTLOG_KEY_PREFIX}{k}'
structlog_k = f"{STRUCTLOG_KEY_PREFIX}{k}"
if structlog_k in _CONTEXT_VARS:
_CONTEXT_VARS[structlog_k].set(Ellipsis)
3 changes: 2 additions & 1 deletion tests/test_contextvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.

import pytest
import asyncio

import pytest

from structlog.contextvars import (
bind_contextvars,
clear_contextvars,
Expand Down

0 comments on commit 0806b4a

Please sign in to comment.