Skip to content

Commit 8bf614b

Browse files
edit exception logic in proxy testcase (Azure#22173)
* edit exception logic in proxy testcase * make the same change in async proxy testcase
1 parent 2214245 commit 8bf614b

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

tools/azure-sdk-tools/devtools_testutils/aio/proxy_testcase_async.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ async def combined_call(*args, **kwargs):
5757
# we define test_output before invoking the test so the variable is defined in case of an exception
5858
test_output = None
5959
try:
60-
test_output = await test_func(*args, variables=variables, **trimmed_kwargs)
61-
except TypeError:
62-
logger = logging.getLogger()
63-
logger.info(
64-
"This test can't accept variables as input. The test method should accept `**kwargs` and/or a "
65-
"`variables` parameter to make use of recorded test variables."
66-
)
67-
try:
68-
test_output = await test_func(*args, **trimmed_kwargs)
60+
try:
61+
test_output = await test_func(*args, variables=variables, **trimmed_kwargs)
62+
except TypeError:
63+
logger = logging.getLogger()
64+
logger.info(
65+
"This test can't accept variables as input. The test method should accept `**kwargs` and/or a "
66+
"`variables` parameter to make use of recorded test variables."
67+
)
68+
test_output = await test_func(*args, **trimmed_kwargs)
6969
except ResourceNotFoundError as error:
7070
error_body = ContentDecodePolicy.deserialize_from_http_generics(error.response)
7171
error_with_message = ResourceNotFoundError(message=error_body["Message"], response=error.response)

tools/azure-sdk-tools/devtools_testutils/proxy_testcase.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ def combined_call(*args, **kwargs):
187187
# we define test_output before invoking the test so the variable is defined in case of an exception
188188
test_output = None
189189
try:
190-
test_output = test_func(*args, variables=variables, **trimmed_kwargs)
191-
except TypeError:
192-
logger = logging.getLogger()
193-
logger.info(
194-
"This test can't accept variables as input. The test method should accept `**kwargs` and/or a "
195-
"`variables` parameter to make use of recorded test variables."
196-
)
197-
try:
198-
test_output = test_func(*args, **trimmed_kwargs)
190+
try:
191+
test_output = test_func(*args, variables=variables, **trimmed_kwargs)
192+
except TypeError:
193+
logger = logging.getLogger()
194+
logger.info(
195+
"This test can't accept variables as input. The test method should accept `**kwargs` and/or a "
196+
"`variables` parameter to make use of recorded test variables."
197+
)
198+
test_output = test_func(*args, **trimmed_kwargs)
199199
except ResourceNotFoundError as error:
200200
error_body = ContentDecodePolicy.deserialize_from_http_generics(error.response)
201201
error_with_message = ResourceNotFoundError(message=error_body["Message"], response=error.response)

0 commit comments

Comments
 (0)