Skip to content

Commit

Permalink
actually run precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Jan 30, 2024
1 parent dbfea51 commit 24f6006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 2 additions & 3 deletions tests/unit/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def get_all_subclasses(cls):


class TestEventCodes:

# checks to see if event codes are duplicated to keep codes singluar and clear.
# also checks that event codes follow correct namming convention ex. E001
def test_event_codes(self):
Expand Down Expand Up @@ -63,7 +62,6 @@ def test_event_codes(self):


class TestEventJSONSerialization:

# attempts to test that every event is serializable to json.
# event types that take `Any` are not possible to test in this way since some will serialize
# just fine and others won't.
Expand All @@ -79,7 +77,7 @@ def test_all_serializable(self):

# make sure everything in the list is a value not a type
for event in sample_values:
assert type(event) != type
assert not isinstance(event, type)

# if we have everything we need to test, try to serialize everything
count = 0
Expand Down Expand Up @@ -108,6 +106,7 @@ def test_all_serializable(self):
count += 1
print(f"--- Found {count} events")


def test_bad_serialization():
"""Tests that bad serialization enters the proper exception handling
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/test_proto_events.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from dbt_common.events.functions import msg_to_dict, msg_to_json, reset_metadata_vars
from dbt_common.events import types_pb2
from dbt_common.events.base_types import msg_from_base_event
from dbt_common.events.types import (
RetryExternalCall
)
from dbt_common.events import types_pb2
from dbt_common.events.types import RetryExternalCall
from google.protobuf.json_format import MessageToDict

info_keys = {
Expand All @@ -22,7 +19,6 @@


def test_events():

# M020 event
event_code = "M020"
event = RetryExternalCall(attempt=3, max=5)
Expand All @@ -48,8 +44,8 @@ def test_events():
assert new_msg.info.code == msg.info.code
assert new_msg.data.attempt == msg.data.attempt

def test_extra_dict_on_event(monkeypatch):

def test_extra_dict_on_event(monkeypatch):
monkeypatch.setenv("DBT_ENV_CUSTOM_ENV_env_key", "env_value")

reset_metadata_vars()
Expand Down

0 comments on commit 24f6006

Please sign in to comment.