From cf5fad2675cc933aded04ba0558bbfe6e15acd88 Mon Sep 17 00:00:00 2001 From: wim glenn Date: Fri, 26 Mar 2021 12:35:56 -0500 Subject: [PATCH 1/2] test also on python 3.9 --- .travis.yml | 1 + setup.cfg | 2 -- setup.py | 1 + tests/test_issue14.py | 27 +++++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 setup.cfg create mode 100644 tests/test_issue14.py diff --git a/.travis.yml b/.travis.yml index 16af9f5..6398201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: - "3.6" - "3.7" - "3.8" + - "3.9" - "nightly" matrix: diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0b2360c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = true diff --git a/setup.py b/setup.py index 117fc35..5e65659 100644 --- a/setup.py +++ b/setup.py @@ -19,4 +19,5 @@ "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], + options={"bdist_wheel": {"universal": "1"}}, ) diff --git a/tests/test_issue14.py b/tests/test_issue14.py new file mode 100644 index 0000000..25e03c5 --- /dev/null +++ b/tests/test_issue14.py @@ -0,0 +1,27 @@ +import structlog + + +logger: structlog.stdlib.BoundLogger = structlog.get_logger("some logger") + + +def test_first(): + structlog.configure( + processors=[ + structlog.stdlib.filter_by_level, + structlog.stdlib.ProcessorFormatter.wrap_for_formatter, + ], + context_class=dict, + logger_factory=structlog.stdlib.LoggerFactory(), + wrapper_class=structlog.stdlib.BoundLogger, + cache_logger_on_first_use=False, + ) + logger.warning("test") + + +def test_second(log): + logger.warning("test") + assert log.has("test") + + +def test_third(): + logger.warning("test") From a979150abd7710392e725ae99bd8f1d22613a13b Mon Sep 17 00:00:00 2001 From: wim glenn Date: Fri, 26 Mar 2021 12:38:31 -0500 Subject: [PATCH 2/2] remove annotation since that is not 2.7 compat --- tests/test_issue14.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_issue14.py b/tests/test_issue14.py index 25e03c5..ee71093 100644 --- a/tests/test_issue14.py +++ b/tests/test_issue14.py @@ -1,7 +1,7 @@ import structlog -logger: structlog.stdlib.BoundLogger = structlog.get_logger("some logger") +logger = structlog.get_logger("some logger") def test_first():