diff --git a/openbb_platform/extensions/tests/test_integration_tests_api.py b/openbb_platform/extensions/tests/test_integration_tests_api.py index 60214392308..5904328a821 100644 --- a/openbb_platform/extensions/tests/test_integration_tests_api.py +++ b/openbb_platform/extensions/tests/test_integration_tests_api.py @@ -20,10 +20,10 @@ def run_test(test_type: str, check_function) -> None: @pytest.mark.skip(reason="Needs uvicorn to be launched but shouldn't be the case.") def test_api_interface_integration_test_providers() -> None: """Test if there are any missing providers for integration tests.""" - run_test("integration", check_missing_integration_test_providers) + run_test("api", check_missing_integration_test_providers) @pytest.mark.skip(reason="Needs uvicorn to be launched but shouldn't be the case.") def test_api_interface_integration_test_params() -> None: """Test if there are any missing params for integration tests.""" - run_test("integration", check_missing_integration_test_params) + run_test("api", check_missing_integration_test_params) diff --git a/openbb_platform/extensions/tests/test_integration_tests_python.py b/openbb_platform/extensions/tests/test_integration_tests_python.py index 239297d44da..0575ebdc64e 100644 --- a/openbb_platform/extensions/tests/test_integration_tests_python.py +++ b/openbb_platform/extensions/tests/test_integration_tests_python.py @@ -18,9 +18,9 @@ def run_test(test_type: str, check_function) -> None: def test_python_interface_integration_test_providers() -> None: """Test if there are any missing providers for integration tests.""" - run_test("unit", check_missing_integration_test_providers) + run_test("python", check_missing_integration_test_providers) def test_python_interface_integration_test_params() -> None: """Test if there are any missing params for integration tests.""" - run_test("unit", check_missing_integration_test_params) + run_test("python", check_missing_integration_test_params) diff --git a/openbb_platform/extensions/tests/utils/integration_tests_testers.py b/openbb_platform/extensions/tests/utils/integration_tests_testers.py index f0b820b53f5..3ec0e0de4a2 100644 --- a/openbb_platform/extensions/tests/utils/integration_tests_testers.py +++ b/openbb_platform/extensions/tests/utils/integration_tests_testers.py @@ -12,13 +12,13 @@ from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.router import CommandMap -def get_integration_tests(test_type: Literal["integration", "unit"]) -> List[Any]: +def get_integration_tests(test_type: Literal["api", "python"]) -> List[Any]: """Get integration tests for the OpenBB Platform.""" integration_tests: List[Any] = [] - if test_type == "unit": + if test_type == "python": file_end = "_python.py" - elif test_type == "integration": + elif test_type == "api": file_end = "_api.py" for extension in find_extensions(): @@ -112,9 +112,11 @@ def check_missing_params( if isinstance(command_params, list): for expected_param in command_params[0]: if expected_param not in test_params.keys(): - missing_params.append( - f"Missing param {expected_param} in function {function}" - ) + # if return is the expected param, we can ignore + if expected_param != "return": + missing_params.append( + f"Missing param {expected_param} in function {function}" + ) return missing_params @@ -170,6 +172,7 @@ def check_integration_tests( missing_items = check_function( processing_command_params, function_params, function, True ) + all_missing_items.extend(missing_items) return all_missing_items