Skip to content

Commit

Permalink
Paramterize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Jan 22, 2021
1 parent 47214aa commit 0be108a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/utils/public_interfaces_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# specific language governing permissions and limitations
# under the License.
# pylint: disable=no-self-use
import pytest

from superset.sql_lab import dummy_sql_query_mutator
from superset.utils.public_interfaces import compute_hash, get_warning_message
from tests.base_tests import SupersetTestCase
Expand All @@ -27,13 +29,8 @@
}


class PublicInterfacesTest(SupersetTestCase):

@pytest.mark.parametrize("interface,expected_hash", list(hashes.items()))
def test_public_interfaces(interface, expected_hash):
"""Test that public interfaces have not been accidentally changed."""

def test_dummy_sql_query_mutator(self):
for interface, expected_hash in hashes.items():
current_hash = compute_hash(dummy_sql_query_mutator)
assert current_hash == expected_hash, get_warning_message(
dummy_sql_query_mutator, current_hash
)
current_hash = compute_hash(interface)
assert current_hash == expected_hash, get_warning_message(interface, current_hash)

0 comments on commit 0be108a

Please sign in to comment.