Lint and skip

This commit is contained in:
Igor Radovanovic
2023-10-04 21:46:06 +02:00
parent 27c399318d
commit b06e9da721
6 changed files with 76 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ test_locations = [
"openbb_platform/tests",
"openbb_platform/platform",
"openbb_platform/providers",
"openbb_platform/extensions",
]

View File

@@ -1,6 +1,5 @@
import json
import random
from typing import List
import pytest
import requests

View File

@@ -1,6 +1,5 @@
import json
import random
from typing import List
import pytest
import requests

View File

@@ -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

View File

@@ -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)

View File

@@ -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