Skip to content

Commit d5b9578

Browse files
Copilotalvarolopez
andcommitted
Remove async keyword from tests that don't require async features
Co-authored-by: alvarolopez <[email protected]>
1 parent 7e9be33 commit d5b9578

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

deepaas/tests/test_cmd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def uvicorn_run_fixture():
3737
return mock.MagicMock()
3838

3939

40-
async def test_run(monkeypatch, fastapi_app_fixture, uvicorn_run_fixture):
40+
def test_run(monkeypatch, fastapi_app_fixture, uvicorn_run_fixture):
4141
"""Test the run command."""
4242
# uvicorn_run_fixture = mock.MagicMock()
4343
monkeypatch.setattr(deepaas.cmd._shutdown, "handle_signals", mock.MagicMock())
@@ -72,7 +72,7 @@ def set_flag(flag, value):
7272
CONF.clear_override(flag)
7373

7474

75-
async def test_run_custom_ip_port(
75+
def test_run_custom_ip_port(
7676
monkeypatch, cfg_fixture, fastapi_app_fixture, uvicorn_run_fixture
7777
):
7878
"""Run the cmd line with a custom IP and port."""
@@ -93,7 +93,7 @@ async def test_run_custom_ip_port(
9393
uvicorn_run_fixture.assert_called_with(fastapi_app_fixture(), host=ip, port=port)
9494

9595

96-
async def test_custom_base_path(monkeypatch, cfg_fixture, fastapi_app_fixture):
96+
def test_custom_base_path(monkeypatch, cfg_fixture, fastapi_app_fixture):
9797
"""Run the cmd line with a custom base path."""
9898
monkeypatch.setattr(deepaas.config, "setup", lambda x: None)
9999

@@ -112,7 +112,7 @@ async def test_custom_base_path(monkeypatch, cfg_fixture, fastapi_app_fixture):
112112
)
113113

114114

115-
async def test_custom_base_path_no_slash(monkeypatch, cfg_fixture, fastapi_app_fixture):
115+
def test_custom_base_path_no_slash(monkeypatch, cfg_fixture, fastapi_app_fixture):
116116
"""Run the cmd line with a custom base path without a slash."""
117117
monkeypatch.setattr(deepaas.config, "setup", lambda x: None)
118118

@@ -134,7 +134,7 @@ async def test_custom_base_path_no_slash(monkeypatch, cfg_fixture, fastapi_app_f
134134
)
135135

136136

137-
async def test_doc_endpoint_disabled(monkeypatch, cfg_fixture, fastapi_app_fixture):
137+
def test_doc_endpoint_disabled(monkeypatch, cfg_fixture, fastapi_app_fixture):
138138
"""Run the cmd line with doc endpoint disabled."""
139139
monkeypatch.setattr(deepaas.config, "setup", lambda x: None)
140140

deepaas/tests/test_v2_models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
@pytest.fixture
33-
async def mocks(monkeypatch):
33+
def mocks(monkeypatch):
3434
model_name = uuid.uuid4().hex
3535
monkeypatch.setattr(
3636
deepaas.model.loading,
@@ -80,15 +80,15 @@ def warm(self, **kwargs):
8080
m.get_predict_args()
8181

8282

83-
async def test_bad_schema(mocks):
83+
def test_bad_schema(mocks):
8484
class Model(object):
8585
schema = []
8686

8787
with pytest.raises(exceptions.ModelResponseValidationError):
8888
v2_wrapper.ModelWrapper("test", Model())
8989

9090

91-
async def test_validate_no_schema(mocks):
91+
def test_validate_no_schema(mocks):
9292
class Model(object):
9393
schema = None
9494

@@ -97,15 +97,15 @@ class Model(object):
9797
wrapper.validate_response(None)
9898

9999

100-
async def test_invalid_schema(mocks):
100+
def test_invalid_schema(mocks):
101101
class Model(object):
102102
schema = object()
103103

104104
with pytest.raises(exceptions.ModelResponseValidationError):
105105
v2_wrapper.ModelWrapper("test", Model())
106106

107107

108-
async def test_marshmallow_schema(mocks):
108+
def test_marshmallow_schema(mocks):
109109
class Schema(marshmallow.Schema):
110110
foo = m_fields.Str()
111111

@@ -119,7 +119,7 @@ class Model(object):
119119
wrapper.validate_response({"foo": 1.0})
120120

121121

122-
async def test_dict_schema(mocks):
122+
def test_dict_schema(mocks):
123123
class Model(object):
124124
schema = {"foo": m_fields.Str()}
125125

@@ -135,7 +135,7 @@ def model():
135135
return fake_v2_model.TestModel()
136136

137137

138-
async def test_dummy_model(model, mocks):
138+
def test_dummy_model(model, mocks):
139139
pred = model.predict()
140140
pred.pop("data")
141141
assert pred == {
@@ -191,7 +191,7 @@ async def test_model_with_not_implemented_attributes_and_wrapper(mocks):
191191
assert isinstance(val, fields.Field)
192192

193193

194-
async def test_loading_ok(mocks):
194+
def test_loading_ok(mocks):
195195
deepaas.model.v2.load_model()
196196

197197
m = deepaas.model.v2.MODEL
@@ -200,7 +200,7 @@ async def test_loading_ok(mocks):
200200
# assert isinstance(m, v2_wrapper.ModelWrapper)
201201

202202

203-
async def test_loading_ok_singleton(mocks, monkeypatch):
203+
def test_loading_ok_singleton(mocks, monkeypatch):
204204
deepaas.model.v2.load_model()
205205
new_model_name = uuid.uuid4().hex
206206
monkeypatch.setattr(

0 commit comments

Comments
 (0)