diff --git a/tests/base_api_tests.py b/tests/base_api_tests.py index 5364b53d2f1e0..7a0481301a304 100644 --- a/tests/base_api_tests.py +++ b/tests/base_api_tests.py @@ -20,6 +20,7 @@ from flask_appbuilder.models.sqla.interface import SQLAInterface import prison +import tests.test_app from superset import db, security_manager from superset.extensions import appbuilder from superset.models.dashboard import Dashboard diff --git a/tests/dashboard_api_tests.py b/tests/dashboard_api_tests.py index 2f72b2ea9af7e..af16e5fbdeabc 100644 --- a/tests/dashboard_api_tests.py +++ b/tests/dashboard_api_tests.py @@ -14,12 +14,14 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Superset""" import json from typing import List import prison +import tests.test_app from superset import db, security_manager from superset.models import core as models from superset.models.slice import Slice diff --git a/tests/dashboard_tests.py b/tests/dashboard_tests.py index 9ee6a32109cff..c4a7f49421216 100644 --- a/tests/dashboard_tests.py +++ b/tests/dashboard_tests.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Superset""" import json import unittest @@ -22,6 +23,7 @@ from flask import escape from sqlalchemy import func +import tests.test_app from superset import db, security_manager from superset.connectors.sqla.models import SqlaTable from superset.models import core as models diff --git a/tests/database_api_tests.py b/tests/database_api_tests.py index 7baeb6ca3e7c5..adfc43f6447a9 100644 --- a/tests/database_api_tests.py +++ b/tests/database_api_tests.py @@ -14,11 +14,13 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Superset""" import json import prison +import tests.test_app from superset import db from superset.models.core import Database from superset.utils.core import get_example_database diff --git a/tests/dataframe_test.py b/tests/dataframe_test.py index 71aff104780c6..fdb0207bba8cd 100644 --- a/tests/dataframe_test.py +++ b/tests/dataframe_test.py @@ -14,9 +14,11 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import numpy as np import pandas as pd +import tests.test_app from superset.dataframe import df_to_records from superset.db_engine_specs import BaseEngineSpec from superset.result_set import SupersetResultSet diff --git a/tests/druid_func_tests.py b/tests/druid_func_tests.py index c1ac6a908210b..1ed7057bc7918 100644 --- a/tests/druid_func_tests.py +++ b/tests/druid_func_tests.py @@ -14,10 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import json import unittest from unittest.mock import Mock +import tests.test_app import superset.connectors.druid.models as models from superset.connectors.druid.models import DruidColumn, DruidDatasource, DruidMetric from superset.exceptions import SupersetException diff --git a/tests/log_api_tests.py b/tests/log_api_tests.py index 86ee1732f5f8b..dbf1084c1fd57 100644 --- a/tests/log_api_tests.py +++ b/tests/log_api_tests.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Superset""" import json from typing import Optional @@ -21,6 +22,7 @@ import prison from flask_appbuilder.security.sqla.models import User +import tests.test_app from superset import db from superset.models.core import Log diff --git a/tests/model_tests.py b/tests/model_tests.py index 24a87b6e594d5..6c93ed807fe30 100644 --- a/tests/model_tests.py +++ b/tests/model_tests.py @@ -14,12 +14,14 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import textwrap import unittest import pandas from sqlalchemy.engine.url import make_url +import tests.test_app from superset import app from superset.models.core import Database from superset.utils.core import get_example_database, QueryStatus diff --git a/tests/result_set_tests.py b/tests/result_set_tests.py index 6e7df13b69ce4..1f697cc814d58 100644 --- a/tests/result_set_tests.py +++ b/tests/result_set_tests.py @@ -14,11 +14,13 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file from datetime import datetime import numpy as np import pandas as pd +import tests.test_app from superset.dataframe import df_to_records from superset.db_engine_specs import BaseEngineSpec from superset.result_set import dedup, SupersetResultSet diff --git a/tests/security_tests.py b/tests/security_tests.py index 864d28eacf36e..a0718fd1e7602 100644 --- a/tests/security_tests.py +++ b/tests/security_tests.py @@ -14,12 +14,14 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import inspect import unittest from unittest.mock import Mock, patch import prison +import tests.test_app from superset import app, appbuilder, db, security_manager, viz from superset.connectors.druid.models import DruidCluster, DruidDatasource from superset.connectors.sqla.models import SqlaTable diff --git a/tests/sql_validator_tests.py b/tests/sql_validator_tests.py index 553e799039fa8..4cf2956bae748 100644 --- a/tests/sql_validator_tests.py +++ b/tests/sql_validator_tests.py @@ -14,12 +14,14 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Sql Lab""" import unittest from unittest.mock import MagicMock, patch from pyhive.exc import DatabaseError +import tests.test_app from superset import app from superset.sql_validators import SQLValidationAnnotation from superset.sql_validators.base import BaseSQLValidator diff --git a/tests/sqla_models_tests.py b/tests/sqla_models_tests.py index b927ce8402742..e959989b33d9d 100644 --- a/tests/sqla_models_tests.py +++ b/tests/sqla_models_tests.py @@ -14,6 +14,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file +import tests.test_app from superset.connectors.sqla.models import SqlaTable, TableColumn from superset.db_engine_specs.druid import DruidEngineSpec from superset.utils.core import get_example_database diff --git a/tests/sqllab_tests.py b/tests/sqllab_tests.py index be452c558781a..27be7f157832c 100644 --- a/tests/sqllab_tests.py +++ b/tests/sqllab_tests.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Sql Lab""" import json from datetime import datetime, timedelta @@ -21,6 +22,7 @@ import prison +import tests.test_app from superset import db, security_manager from superset.connectors.sqla.models import SqlaTable from superset.dataframe import df_to_records diff --git a/tests/strategy_tests.py b/tests/strategy_tests.py index 31a6bdfb3c6e7..e39a2bc32dfaa 100644 --- a/tests/strategy_tests.py +++ b/tests/strategy_tests.py @@ -14,10 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file """Unit tests for Superset cache warmup""" import json from unittest.mock import MagicMock +import tests.test_app from superset import db from superset.models.core import Log from superset.models.tags import get_tag, ObjectTypes, TaggedObject, TagTypes diff --git a/tests/utils_tests.py b/tests/utils_tests.py index 67363ac6a4790..81cc37cbd2013 100644 --- a/tests/utils_tests.py +++ b/tests/utils_tests.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import unittest import uuid from datetime import date, datetime, time, timedelta @@ -25,6 +26,7 @@ from flask_caching import Cache from sqlalchemy.exc import ArgumentError +import tests.test_app from superset import app, db, security_manager from superset.exceptions import SupersetException from superset.models.core import Database diff --git a/tests/viz_tests.py b/tests/viz_tests.py index b9edb5670e491..2b1752daa6fae 100644 --- a/tests/viz_tests.py +++ b/tests/viz_tests.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# isort:skip_file import uuid from datetime import datetime from math import nan @@ -22,6 +23,7 @@ import numpy as np import pandas as pd +import tests.test_app import superset.viz as viz from superset import app from superset.constants import NULL_STRING diff --git a/tox.ini b/tox.ini index 8da0d30306148..ad46503b5391a 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ commands = {toxinidir}/superset/bin/superset db upgrade {toxinidir}/superset/bin/superset init nosetests tests/load_examples_test.py - nosetests -e load_examples_test tests {posargs} + nosetests --exclude=load_examples_test {posargs:tests} deps = -rrequirements.txt -rrequirements-dev.txt