Skip to content

Commit f2ef154

Browse files
committed
fix(serve): Restore the import that test_import_deprecation_warning exercises
The ruff F401 pass removed ``from sagemaker.serve.serverless.serverless_inference_config import ServerlessInferenceConfig`` from inside the test because the name is not used, but that import is the action under test: it is what emits the DeprecationWarning the assertions look for. Without it the test recorded zero warnings. Restored with a noqa and a comment saying why it stays.
1 parent 367417a commit f2ef154

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎sagemaker-serve/tests/unit/serverless/test_serverless_inference_config.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ def test_import_deprecation_warning(self):
1212
if "sagemaker.serve.serverless.serverless_inference_config" in sys.modules:
1313
del sys.modules["sagemaker.serve.serverless.serverless_inference_config"]
1414

15+
# The import is the action under test: it emits the deprecation warning.
16+
from sagemaker.serve.serverless.serverless_inference_config import ( # noqa: F401
17+
ServerlessInferenceConfig,
18+
)
19+
1520
self.assertGreaterEqual(len(w), 1)
1621
# Check if any warning is a DeprecationWarning
1722
has_deprecation = any(issubclass(warning.category, DeprecationWarning) for warning in w)

0 commit comments

Comments
 (0)