Skip to content

Commit b75aca3

Browse files
committed
Add a tests
Also fix mypy settings for tests and noxfile
1 parent 6936d95 commit b75aca3

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

mypy.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[mypy]
2+
exclude = "/tests/"
3+
4+
[mypy-tests.*]
5+
ignore_errors = true
6+
7+
[mypy-noxfile]
8+
ignore_errors = true

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ develop = [
4343
"Documentation" = "https://github.com/elastic/ecs-logging-python"
4444
"Issue Tracker" = "https://github.com/elastic/ecs-logging-python/issues"
4545
"Changelog" = "https://github.com/elastic/ecs-logging-python/blob/master/CHANGELOG.md"
46+
47+
[mypy]
48+
exclude = "/tests/"
49+
50+
["mypy-tests.*"]
51+
ignore_errors = true

tests/test_stdlib_formatter.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
import logging
19+
import logging.config
1920
import mock
2021
import pytest
2122
import json
@@ -327,3 +328,12 @@ def test_stack_info_excluded(logger, exclude_fields):
327328

328329
ecs = json.loads(stream.getvalue().rstrip())
329330
assert "error" not in ecs
331+
332+
333+
def test_stdlibformatter_signature():
334+
logging.config.dictConfig(
335+
{
336+
"version": 1,
337+
"formatters": {"my_formatter": {"class": "ecs_logging.StdlibFormatter"}},
338+
}
339+
)

0 commit comments

Comments
 (0)