|
1 | | -from unittest.mock import ANY, AsyncMock, MagicMock |
| 1 | +from unittest.mock import ANY, MagicMock |
2 | 2 |
|
3 | 3 | import pytest |
4 | 4 |
|
5 | 5 | from openfeature.client import ClientMetadata |
6 | 6 | from openfeature.evaluation_context import EvaluationContext |
7 | 7 | from openfeature.flag_evaluation import FlagEvaluationDetails, FlagType |
8 | | -from openfeature.hook import AsyncHook, Hook, HookContext |
| 8 | +from openfeature.hook import Hook, HookContext |
9 | 9 | from openfeature.hook._hook_support import ( |
10 | 10 | after_all_hooks, |
11 | 11 | after_hooks, |
@@ -86,23 +86,6 @@ def test_error_hooks_run_error_method(mock_hook): |
86 | 86 | ) |
87 | 87 |
|
88 | 88 |
|
89 | | -@pytest.mark.asyncio |
90 | | -async def test_error_hooks_run_error_method_async(mock_hook_async): |
91 | | - # Given |
92 | | - hook_context = HookContext("flag_key", FlagType.BOOLEAN, True, "") |
93 | | - hook_hints = MappingProxyType({}) |
94 | | - # When |
95 | | - await error_hooks_async( |
96 | | - FlagType.BOOLEAN, hook_context, Exception, [mock_hook_async], hook_hints |
97 | | - ) |
98 | | - # Then |
99 | | - mock_hook_async.supports_flag_value_type.assert_called_once() |
100 | | - mock_hook_async.error.assert_called_once() |
101 | | - mock_hook_async.error.assert_called_with( |
102 | | - hook_context=hook_context, exception=ANY, hints=hook_hints |
103 | | - ) |
104 | | - |
105 | | - |
106 | 89 | def test_before_hooks_run_before_method(mock_hook): |
107 | 90 | # Given |
108 | 91 | hook_context = HookContext("flag_key", FlagType.BOOLEAN, True, "") |
|
0 commit comments