From b06e9da721b27fd39567932bb54e7b15bf448719 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:46:06 +0200 Subject: [PATCH] Lint and skip --- noxfile.py | 1 + .../integration/test_econometrics_api.py | 1 - .../extensions/qa/integration/test_qa_api.py | 1 - .../extensions/ta/integration/test_ta_api.py | 79 ++++++++++++++++--- .../tests/test_integration_tests_api.py | 3 + .../utils/integration_tests_generator.py | 4 +- 6 files changed, 76 insertions(+), 13 deletions(-) diff --git a/noxfile.py b/noxfile.py index 7acd1a4fcb6..66f4b95e2aa 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,6 +4,7 @@ test_locations = [ "openbb_platform/tests", "openbb_platform/platform", "openbb_platform/providers", + "openbb_platform/extensions", ] diff --git a/openbb_platform/extensions/econometrics/integration/test_econometrics_api.py b/openbb_platform/extensions/econometrics/integration/test_econometrics_api.py index bf7f0b88343..e8871463163 100644 --- a/openbb_platform/extensions/econometrics/integration/test_econometrics_api.py +++ b/openbb_platform/extensions/econometrics/integration/test_econometrics_api.py @@ -1,6 +1,5 @@ import json import random -from typing import List import pytest import requests diff --git a/openbb_platform/extensions/qa/integration/test_qa_api.py b/openbb_platform/extensions/qa/integration/test_qa_api.py index 566e3d5fd4b..ae470fddae5 100644 --- a/openbb_platform/extensions/qa/integration/test_qa_api.py +++ b/openbb_platform/extensions/qa/integration/test_qa_api.py @@ -1,6 +1,5 @@ import json import random -from typing import List import pytest import requests diff --git a/openbb_platform/extensions/ta/integration/test_ta_api.py b/openbb_platform/extensions/ta/integration/test_ta_api.py index 3b500e96e7f..25bcb1b90fd 100644 --- a/openbb_platform/extensions/ta/integration/test_ta_api.py +++ b/openbb_platform/extensions/ta/integration/test_ta_api.py @@ -1,6 +1,5 @@ import json import random -from typing import List import pytest import requests @@ -177,7 +176,15 @@ def test_ta_fisher(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "index": "", "fast": "", "slow": "", "offset": ""}), + ( + { + "data": get_stocks_data(), + "index": "", + "fast": "", + "slow": "", + "offset": "", + } + ), ( { "data": get_crypto_data(), @@ -243,7 +250,15 @@ def test_ta_bbands(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "target": "", "index": "", "length": "", "offset": ""}), + ( + { + "data": get_stocks_data(), + "target": "", + "index": "", + "length": "", + "offset": "", + } + ), ( { "data": get_crypto_data(), @@ -296,7 +311,15 @@ def test_ta_aroon(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "target": "", "index": "", "length": "", "offset": ""}), + ( + { + "data": get_stocks_data(), + "target": "", + "index": "", + "length": "", + "offset": "", + } + ), ( { "data": get_crypto_data(), @@ -416,7 +439,15 @@ def test_ta_macd(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "target": "", "index": "", "length": "", "offset": ""}), + ( + { + "data": get_stocks_data(), + "target": "", + "index": "", + "length": "", + "offset": "", + } + ), ( { "data": get_crypto_data(), @@ -518,7 +549,14 @@ def test_ta_ichimoku(params, headers): "params", [ ({"data": get_stocks_data(), "index": "", "target": "", "period": ""}), - ({"data": get_crypto_data(), "index": "date", "target": "close", "period": "95"}), + ( + { + "data": get_crypto_data(), + "index": "date", + "target": "close", + "period": "95", + } + ), ], ) @pytest.mark.integration @@ -555,7 +593,15 @@ def test_ta_ad(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "index": "", "length": "", "scalar": "", "drift": ""}), + ( + { + "data": get_stocks_data(), + "index": "", + "length": "", + "scalar": "", + "drift": "", + } + ), ( { "data": get_crypto_data(), @@ -582,7 +628,15 @@ def test_ta_adx(params, headers): @pytest.mark.parametrize( "params", [ - ({"data": get_stocks_data(), "target": "", "index": "", "length": "", "offset": ""}), + ( + { + "data": get_stocks_data(), + "target": "", + "index": "", + "length": "", + "offset": "", + } + ), ( { "data": get_crypto_data(), @@ -610,7 +664,14 @@ def test_ta_wma(params, headers): "params", [ ({"data": get_stocks_data(), "index": "", "length": "", "scalar": ""}), - ({"data": get_crypto_data(), "index": "date", "length": "16", "scalar": "0.02"}), + ( + { + "data": get_crypto_data(), + "index": "date", + "length": "16", + "scalar": "0.02", + } + ), ], ) @pytest.mark.integration diff --git a/openbb_platform/extensions/tests/test_integration_tests_api.py b/openbb_platform/extensions/tests/test_integration_tests_api.py index d113a0eef90..60214392308 100644 --- a/openbb_platform/extensions/tests/test_integration_tests_api.py +++ b/openbb_platform/extensions/tests/test_integration_tests_api.py @@ -1,4 +1,5 @@ """Test the integration tests.""" +import pytest from extensions.tests.utils.integration_tests_testers import ( check_missing_integration_test_params, check_missing_integration_test_providers, @@ -16,11 +17,13 @@ def run_test(test_type: str, check_function) -> None: assert not missing_items, "\n".join(missing_items) +@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) +@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) diff --git a/openbb_platform/extensions/tests/utils/integration_tests_generator.py b/openbb_platform/extensions/tests/utils/integration_tests_generator.py index 1d02868d312..2e2ed72280d 100644 --- a/openbb_platform/extensions/tests/utils/integration_tests_generator.py +++ b/openbb_platform/extensions/tests/utils/integration_tests_generator.py @@ -1,9 +1,9 @@ """Integration test generator.""" from pathlib import Path, PosixPath -from platform.core.openbb_core.app.provider_interface import ProviderInterface -from platform.core.openbb_core.app.router import CommandMap from typing import Any, Dict, List, Literal, Tuple, Type, get_origin, get_type_hints +from openbb_core.app.provider_interface import ProviderInterface +from openbb_core.app.router import CommandMap from pydantic.fields import FieldInfo from pydantic_core import PydanticUndefined