Skip to content

Commit

Permalink
Add unit tests for recent stringifier functors added to events library.
Browse files Browse the repository at this point in the history
  • Loading branch information
VersusFacit committed Oct 18, 2022
1 parent ff2f1f4 commit a622e76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ def test_formatting(self):
event = AdapterEventDebug(name="dbt_tests", base_msg="boop{x}boop", args=())
assert "boop{x}boop" in event.message()

# ensure AdapterLogger and subclasses makes all base_msg members
# of type string; when someone writes logger.debug(a) where a is
# any non-string object
event = AdapterEventDebug(name="dbt_tests", base_msg=[1,2,3], args=(3,))
assert isinstance(event.base_msg, str)

event = MacroEventDebug(msg="adsf") # [1,2,3])
assert isinstance(event.msg, str)


class TestEventCodes:

Expand Down

0 comments on commit a622e76

Please sign in to comment.