Skip to content

Commit

Permalink
[tox] Allowing running of specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bodley committed Feb 6, 2020
1 parent 916d184 commit 8a399db
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/base_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/dashboard_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/dashboard_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/database_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/dataframe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/druid_func_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/log_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
# 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

import prison
from flask_appbuilder.security.sqla.models import User

import tests.test_app
from superset import db
from superset.models.core import Log

Expand Down
2 changes: 2 additions & 0 deletions tests/model_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/result_set_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/sql_validator_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/sqla_models_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/sqllab_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
# 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
from random import random

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
Expand Down
2 changes: 2 additions & 0 deletions tests/strategy_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/viz_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a399db

Please sign in to comment.