Skip to content

Commit 7b1e5c1

Browse files
authored
infra: black format unit tests (#2305)
1 parent aad9f6d commit 7b1e5c1

22 files changed

+39
-39
lines changed

tests/unit/sagemaker/model/test_framework_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, sagemaker_session, **kwargs):
5656
ROLE,
5757
ENTRY_POINT,
5858
sagemaker_session=sagemaker_session,
59-
**kwargs
59+
**kwargs,
6060
)
6161

6262
def create_predictor(self, endpoint_name):
@@ -71,7 +71,7 @@ def __init__(self, sagemaker_session, entry_point, **kwargs):
7171
ROLE,
7272
entry_point=entry_point,
7373
sagemaker_session=sagemaker_session,
74-
**kwargs
74+
**kwargs,
7575
)
7676

7777
def create_predictor(self, endpoint_name):

tests/unit/sagemaker/tensorflow/test_estimator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _build_tf(
159159
py_version=None,
160160
instance_type=None,
161161
base_job_name=None,
162-
**kwargs
162+
**kwargs,
163163
):
164164
return TensorFlow(
165165
entry_point=SCRIPT_PATH,
@@ -170,7 +170,7 @@ def _build_tf(
170170
instance_count=INSTANCE_COUNT,
171171
instance_type=instance_type if instance_type else INSTANCE_TYPE,
172172
base_job_name=base_job_name,
173-
**kwargs
173+
**kwargs,
174174
)
175175

176176

tests/unit/sagemaker/tensorflow/test_estimator_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _build_tf(sagemaker_session, **kwargs):
3535
role="dummy-role",
3636
instance_count=1,
3737
instance_type="ml.c4.xlarge",
38-
**kwargs
38+
**kwargs,
3939
)
4040

4141

tests/unit/test_amazon_estimator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_init_enable_network_isolation(sagemaker_session):
8686
num_components=55,
8787
sagemaker_session=sagemaker_session,
8888
enable_network_isolation=True,
89-
**COMMON_ARGS
89+
**COMMON_ARGS,
9090
)
9191
assert pca.num_components == 55
9292
assert pca.enable_network_isolation() is True
@@ -99,7 +99,7 @@ def test_init_all_pca_hyperparameters(sagemaker_session):
9999
subtract_mean=True,
100100
extra_components=33,
101101
sagemaker_session=sagemaker_session,
102-
**COMMON_ARGS
102+
**COMMON_ARGS,
103103
)
104104
assert pca.num_components == 55
105105
assert pca.algorithm_mode == "randomized"
@@ -112,7 +112,7 @@ def test_init_estimator_args(sagemaker_session):
112112
max_run=1234,
113113
sagemaker_session=sagemaker_session,
114114
data_location="s3://some-bucket/some-key/",
115-
**COMMON_ARGS
115+
**COMMON_ARGS,
116116
)
117117
assert pca.instance_type == COMMON_ARGS["instance_type"]
118118
assert pca.instance_count == COMMON_ARGS["instance_count"]
@@ -133,7 +133,7 @@ def test_data_location_does_not_call_default_bucket(sagemaker_session):
133133
num_components=2,
134134
sagemaker_session=sagemaker_session,
135135
data_location=data_location,
136-
**COMMON_ARGS
136+
**COMMON_ARGS,
137137
)
138138
assert pca.data_location == data_location
139139
assert not sagemaker_session.default_bucket.called
@@ -205,7 +205,7 @@ def test_fit_ndarray(time, sagemaker_session):
205205
num_components=55,
206206
sagemaker_session=sagemaker_session,
207207
data_location="s3://{}/key-prefix/".format(BUCKET_NAME),
208-
**kwargs
208+
**kwargs,
209209
)
210210
train = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 8.0], [44.0, 55.0, 66.0]]
211211
labels = [99, 85, 87, 2]
@@ -233,7 +233,7 @@ def test_fit_pass_experiment_config(sagemaker_session):
233233
num_components=55,
234234
sagemaker_session=sagemaker_session,
235235
data_location="s3://{}/key-prefix/".format(BUCKET_NAME),
236-
**kwargs
236+
**kwargs,
237237
)
238238
train = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 8.0], [44.0, 55.0, 66.0]]
239239
labels = [99, 85, 87, 2]

tests/unit/test_chainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _chainer_estimator(
8888
num_processes=None,
8989
process_slots_per_host=None,
9090
additional_mpi_options=None,
91-
**kwargs
91+
**kwargs,
9292
):
9393
return Chainer(
9494
entry_point=SCRIPT_PATH,
@@ -103,7 +103,7 @@ def _chainer_estimator(
103103
num_processes=num_processes,
104104
process_slots_per_host=process_slots_per_host,
105105
additional_mpi_options=additional_mpi_options,
106-
**kwargs
106+
**kwargs,
107107
)
108108

109109

tests/unit/test_estimator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def create_model(
140140
vpc_config_override=vpc_utils.VPC_CONFIG_DEFAULT,
141141
enable_network_isolation=None,
142142
model_dir=None,
143-
**kwargs
143+
**kwargs,
144144
):
145145
if enable_network_isolation is None:
146146
enable_network_isolation = self.enable_network_isolation()
@@ -151,7 +151,7 @@ def create_model(
151151
entry_point=entry_point,
152152
enable_network_isolation=enable_network_isolation,
153153
role=role,
154-
**kwargs
154+
**kwargs,
155155
)
156156

157157
@classmethod
@@ -171,7 +171,7 @@ def __init__(self, sagemaker_session, entry_point=None, role=ROLE, **kwargs):
171171
role,
172172
entry_point or ENTRY_POINT,
173173
sagemaker_session=sagemaker_session,
174-
**kwargs
174+
**kwargs,
175175
)
176176

177177
def create_predictor(self, endpoint_name):

tests/unit/test_fm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_all_hyperparameters(sagemaker_session):
115115
factors_init_scale=1.101,
116116
factors_init_sigma=1.202,
117117
factors_init_value=1.303,
118-
**ALL_REQ_ARGS
118+
**ALL_REQ_ARGS,
119119
)
120120
assert fm.hyperparameters() == dict(
121121
num_factors=str(ALL_REQ_ARGS["num_factors"]),

tests/unit/test_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,10 @@ def test_ecr_login_needed(check_output):
751751
token_response = "AWS:%s" % token
752752
b64_token = base64.b64encode(token_response.encode("utf-8"))
753753
response = {
754-
u"authorizationData": [
754+
"authorizationData": [
755755
{
756-
u"authorizationToken": b64_token,
757-
u"proxyEndpoint": u"https://520713654638.dkr.ecr.us-east-1.amazonaws.com",
756+
"authorizationToken": b64_token,
757+
"proxyEndpoint": "https://520713654638.dkr.ecr.us-east-1.amazonaws.com",
758758
}
759759
],
760760
"ResponseMetadata": {

tests/unit/test_ipinsights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_all_hyperparameters(sagemaker_session):
103103
random_negative_sampling_rate=5,
104104
shuffled_negative_sampling_rate=5,
105105
weight_decay=5.0,
106-
**ALL_REQ_ARGS
106+
**ALL_REQ_ARGS,
107107
)
108108
assert ipinsights.hyperparameters() == dict(
109109
num_entity_vectors=str(ALL_REQ_ARGS["num_entity_vectors"]),

tests/unit/test_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self, sagemaker_session, **kwargs):
107107
ROLE,
108108
SCRIPT_NAME,
109109
sagemaker_session=sagemaker_session,
110-
**kwargs
110+
**kwargs,
111111
)
112112

113113
def prepare_container_def(self, instance_type, accelerator_type=None):

0 commit comments

Comments
 (0)