Skip to content

Commit

Permalink
fix lint error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelinav committed Jul 29, 2020
1 parent 4d37a79 commit aae07e5
Showing 1 changed file with 32 additions and 36 deletions.
68 changes: 32 additions & 36 deletions sdk/python/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import pytest
from google.protobuf.duration_pb2 import Duration
from mock import MagicMock, patch
from pytest_lazyfixture import lazy_fixture
from pytz import timezone

from feast.client import Client
Expand Down Expand Up @@ -253,7 +254,7 @@ def client(self, core_server, serving_server):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_version(self, mocked_client, mocker):
mocked_client._core_service_stub = Core.CoreServiceStub(
Expand Down Expand Up @@ -286,10 +287,10 @@ def test_version(self, mocked_client, mocker):
@pytest.mark.parametrize(
"mocked_client,auth_metadata",
[
(pytest.lazy_fixture("mock_client"), ()),
(pytest.lazy_fixture("mock_client_with_auth"), (AUTH_METADATA)),
(pytest.lazy_fixture("secure_mock_client"), ()),
(pytest.lazy_fixture("secure_mock_client_with_auth"), (AUTH_METADATA)),
(lazy_fixture("mock_client"), ()),
(lazy_fixture("mock_client_with_auth"), (AUTH_METADATA)),
(lazy_fixture("secure_mock_client"), ()),
(lazy_fixture("secure_mock_client_with_auth"), (AUTH_METADATA)),
],
ids=[
"mock_client_without_auth",
Expand Down Expand Up @@ -371,7 +372,7 @@ def int_val(x):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_get_feature_set(self, mocked_client, mocker):
mocked_client._core_service_stub = Core.CoreServiceStub(
Expand Down Expand Up @@ -435,7 +436,7 @@ def test_get_feature_set(self, mocked_client, mocker):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_list_feature_sets(self, mocked_client, mocker):
mocker.patch.object(
Expand Down Expand Up @@ -496,7 +497,7 @@ def test_list_feature_sets(self, mocked_client, mocker):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_list_features(self, mocked_client, mocker):
mocker.patch.object(
Expand Down Expand Up @@ -542,7 +543,7 @@ def test_list_features(self, mocked_client, mocker):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_list_ingest_jobs(self, mocked_client, mocker):
mocker.patch.object(
Expand Down Expand Up @@ -598,7 +599,7 @@ def test_list_ingest_jobs(self, mocked_client, mocker):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_restart_ingest_job(self, mocked_client, mocker):
mocker.patch.object(
Expand All @@ -621,7 +622,7 @@ def test_restart_ingest_job(self, mocked_client, mocker):

@pytest.mark.parametrize(
"mocked_client",
[pytest.lazy_fixture("mock_client"), pytest.lazy_fixture("secure_mock_client")],
[lazy_fixture("mock_client"), lazy_fixture("secure_mock_client")],
)
def test_stop_ingest_job(self, mocked_client, mocker):
mocker.patch.object(
Expand All @@ -645,10 +646,10 @@ def test_stop_ingest_job(self, mocked_client, mocker):
@pytest.mark.parametrize(
"mocked_client",
[
pytest.lazy_fixture("mock_client"),
pytest.lazy_fixture("mock_client_with_auth"),
pytest.lazy_fixture("secure_mock_client"),
pytest.lazy_fixture("secure_mock_client_with_auth"),
lazy_fixture("mock_client"),
lazy_fixture("mock_client_with_auth"),
lazy_fixture("secure_mock_client"),
lazy_fixture("secure_mock_client_with_auth"),
],
)
def test_get_historical_features(self, mocked_client, mocker):
Expand Down Expand Up @@ -768,8 +769,7 @@ def test_get_historical_features(self, mocked_client, mocker):
assert actual_dataframe[["driver_id"]].equals(expected_dataframe[["driver_id"]])

@pytest.mark.parametrize(
"test_client",
[pytest.lazy_fixture("client"), pytest.lazy_fixture("secure_client")],
"test_client", [lazy_fixture("client"), lazy_fixture("secure_client")],
)
def test_apply_feature_set_success(self, test_client):

Expand Down Expand Up @@ -813,8 +813,8 @@ def test_apply_feature_set_success(self, test_client):
@pytest.mark.parametrize(
"dataframe,test_client",
[
(dataframes.GOOD, pytest.lazy_fixture("client")),
(dataframes.GOOD, pytest.lazy_fixture("secure_client")),
(dataframes.GOOD, lazy_fixture("client")),
(dataframes.GOOD, lazy_fixture("secure_client")),
],
)
def test_feature_set_ingest_success(self, dataframe, test_client, mocker):
Expand Down Expand Up @@ -845,7 +845,7 @@ def test_feature_set_ingest_success(self, dataframe, test_client, mocker):

@pytest.mark.parametrize(
"dataframe,test_client,exception",
[(dataframes.GOOD, pytest.lazy_fixture("client"), Exception)],
[(dataframes.GOOD, lazy_fixture("client"), Exception)],
)
def test_feature_set_ingest_throws_exception_if_kafka_down(
self, dataframe, test_client, exception, mocker
Expand Down Expand Up @@ -878,8 +878,8 @@ def test_feature_set_ingest_throws_exception_if_kafka_down(
@pytest.mark.parametrize(
"dataframe,exception,test_client",
[
(dataframes.GOOD, TimeoutError, pytest.lazy_fixture("client")),
(dataframes.GOOD, TimeoutError, pytest.lazy_fixture("secure_client")),
(dataframes.GOOD, TimeoutError, lazy_fixture("client")),
(dataframes.GOOD, TimeoutError, lazy_fixture("secure_client")),
],
)
def test_feature_set_ingest_fail_if_pending(
Expand Down Expand Up @@ -915,26 +915,22 @@ def test_feature_set_ingest_fail_if_pending(
@pytest.mark.parametrize(
"dataframe,exception,test_client",
[
(dataframes.BAD_NO_DATETIME, Exception, pytest.lazy_fixture("client")),
(dataframes.BAD_NO_DATETIME, Exception, lazy_fixture("client")),
(
dataframes.BAD_INCORRECT_DATETIME_TYPE,
Exception,
pytest.lazy_fixture("client"),
),
(dataframes.BAD_NO_ENTITY, Exception, pytest.lazy_fixture("client")),
(dataframes.NO_FEATURES, Exception, pytest.lazy_fixture("client")),
(
dataframes.BAD_NO_DATETIME,
Exception,
pytest.lazy_fixture("secure_client"),
lazy_fixture("client"),
),
(dataframes.BAD_NO_ENTITY, Exception, lazy_fixture("client")),
(dataframes.NO_FEATURES, Exception, lazy_fixture("client")),
(dataframes.BAD_NO_DATETIME, Exception, lazy_fixture("secure_client"),),
(
dataframes.BAD_INCORRECT_DATETIME_TYPE,
Exception,
pytest.lazy_fixture("secure_client"),
lazy_fixture("secure_client"),
),
(dataframes.BAD_NO_ENTITY, Exception, pytest.lazy_fixture("secure_client")),
(dataframes.NO_FEATURES, Exception, pytest.lazy_fixture("secure_client")),
(dataframes.BAD_NO_ENTITY, Exception, lazy_fixture("secure_client")),
(dataframes.NO_FEATURES, Exception, lazy_fixture("secure_client")),
],
)
def test_feature_set_ingest_failure(self, test_client, dataframe, exception):
Expand All @@ -954,8 +950,8 @@ def test_feature_set_ingest_failure(self, test_client, dataframe, exception):
@pytest.mark.parametrize(
"dataframe,test_client",
[
(dataframes.ALL_TYPES, pytest.lazy_fixture("client")),
(dataframes.ALL_TYPES, pytest.lazy_fixture("secure_client")),
(dataframes.ALL_TYPES, lazy_fixture("client")),
(dataframes.ALL_TYPES, lazy_fixture("secure_client")),
],
)
def test_feature_set_types_success(self, test_client, dataframe, mocker):
Expand Down

0 comments on commit aae07e5

Please sign in to comment.