Skip to content

Commit

Permalink
remove async hook tests
Browse files Browse the repository at this point in the history
Signed-off-by: leohoare <leo@insight.co>
  • Loading branch information
leohoare committed Nov 13, 2024
1 parent 3b0c459 commit a6b8325
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions tests/hook/test_hook_support.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from unittest.mock import ANY, AsyncMock, MagicMock
from unittest.mock import ANY, MagicMock

import pytest

from openfeature.client import ClientMetadata
from openfeature.evaluation_context import EvaluationContext
from openfeature.flag_evaluation import FlagEvaluationDetails, FlagType
from openfeature.hook import AsyncHook, Hook, HookContext
from openfeature.hook import Hook, HookContext
from openfeature.hook._hook_support import (
after_all_hooks,
after_hooks,
Expand Down Expand Up @@ -86,23 +86,6 @@ def test_error_hooks_run_error_method(mock_hook):
)


@pytest.mark.asyncio
async def test_error_hooks_run_error_method_async(mock_hook_async):
# Given
hook_context = HookContext("flag_key", FlagType.BOOLEAN, True, "")
hook_hints = MappingProxyType({})
# When
await error_hooks_async(
FlagType.BOOLEAN, hook_context, Exception, [mock_hook_async], hook_hints
)
# Then
mock_hook_async.supports_flag_value_type.assert_called_once()
mock_hook_async.error.assert_called_once()
mock_hook_async.error.assert_called_with(
hook_context=hook_context, exception=ANY, hints=hook_hints
)


def test_before_hooks_run_before_method(mock_hook):
# Given
hook_context = HookContext("flag_key", FlagType.BOOLEAN, True, "")
Expand Down

0 comments on commit a6b8325

Please sign in to comment.