Skip to content

Commit

Permalink
ci: fix Python 3.12 tests
Browse files Browse the repository at this point in the history
It seems taskName is no more included.

Change-Id: I127efbe8ba8a456267cb2500ed7e496914b2668b
  • Loading branch information
jd committed Dec 13, 2024
1 parent a03a69f commit e663f5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions daiquiri/tests/test_daiquiri.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io
import json
import logging
import sys
import typing
import unittest
import warnings
Expand Down Expand Up @@ -42,8 +41,6 @@ def test_setup_json_formatter(self) -> None:
)
daiquiri.getLogger(__name__).warning("foobar")
expected: dict[str, typing.Any] = {"message": "foobar"}
if sys.version_info >= (3, 12):
expected.update({"taskName": None})
self.assertEqual(expected, json.loads(stream.getvalue()))

def test_setup_json_formatter_with_extras(self) -> None:
Expand All @@ -57,8 +54,6 @@ def test_setup_json_formatter_with_extras(self) -> None:
)
daiquiri.getLogger(__name__).warning("foobar", foo="bar")
expected: dict[str, typing.Any] = {"message": "foobar", "foo": "bar"}
if sys.version_info >= (3, 12):
expected.update({"taskName": None})
self.assertEqual(expected, json.loads(stream.getvalue()))

def test_get_logger_set_level(self) -> None:
Expand All @@ -72,7 +67,7 @@ def test_capture_warnings(self) -> None:
line = stream.getvalue()
self.assertIn("WARNING py.warnings: ", line)
self.assertIn(
"daiquiri/tests/test_daiquiri.py:71: "
"daiquiri/tests/test_daiquiri.py:66: "
'UserWarning: omg!\n warnings.warn("omg!")\n',
line,
)
Expand Down
5 changes: 0 additions & 5 deletions daiquiri/tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# under the License.
import json
import logging
import sys
import syslog
import typing
import unittest
Expand Down Expand Up @@ -125,10 +124,6 @@ def test_datadog(self) -> None:
"message": mock.ANY,
},
}
if sys.version_info >= (3, 12):
expected_error_1.update({"taskName": None})
expected_info_1.update({"taskName": None})
expected_error_2.update({"taskName": None})
try:
1 / 0
except ZeroDivisionError:
Expand Down

0 comments on commit e663f5a

Please sign in to comment.