diff options
Diffstat (limited to 'openbb_platform/core/tests/app/test_command_runner.py')
-rw-r--r-- | openbb_platform/core/tests/app/test_command_runner.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/openbb_platform/core/tests/app/test_command_runner.py b/openbb_platform/core/tests/app/test_command_runner.py index 97bfc6df04d..3447d66407b 100644 --- a/openbb_platform/core/tests/app/test_command_runner.py +++ b/openbb_platform/core/tests/app/test_command_runner.py @@ -89,7 +89,7 @@ def test_parameters_builder_get_polished_func(input_func, expected_annotations): polished_func = ParametersBuilder.get_polished_func(input_func) assert polished_func.__annotations__ == expected_annotations - assert polished_func.__signature__ == input_func.__signature__ + assert polished_func.__signature__ == input_func.__signature__ # type: ignore[attr-defined] @pytest.mark.parametrize( @@ -206,10 +206,8 @@ def test_parameters_builder_update_command_context( def test_parameters_builder_update_provider_choices( command_coverage, route, kwargs, route_default, expected_result ): - with patch( - "openbb_core.app.command_runner.ProviderInterface", - **{"return_value.available_providers": ["provider1", "provider2"]}, - ): + with patch("openbb_core.app.command_runner.ProviderInterface") as mock_pi: + mock_pi.available_providers = ["provider1", "provider2"] result = ParametersBuilder.update_provider_choices( mock_func, command_coverage, route, kwargs, route_default ) @@ -293,12 +291,11 @@ def test_parameters_builder_build(mock_func, execution_context): # TODO: add more test cases with @pytest.mark.parametrize - with patch( - "openbb_core.app.command_runner.ProviderInterface", - **{"return_value.available_providers": ["provider1", "provider2"]}, - ): + with patch("openbb_core.app.command_runner.ProviderInterface") as mock_pi: + mock_pi.available_providers = ["provider1", "provider2"] + result = ParametersBuilder.build( - args=[1, 2], + args=(1, 2), kwargs={ "c": 3, "d": "4", |