13
13
from __future__ import absolute_import
14
14
15
15
import unittest
16
+ import pytest
16
17
17
18
from unittest .mock import patch , Mock
18
19
from sagemaker .serve .app import InProcessServer
20
+ from tests .integ .sagemaker .serve .constants import (
21
+ PYTHON_VERSION_IS_NOT_310 ,
22
+ )
19
23
20
24
mock_model_id = "mock_model_id"
21
25
22
26
23
27
class TestAppInProcessServer (unittest .TestCase ):
28
+ @pytest .mark .skipif (
29
+ PYTHON_VERSION_IS_NOT_310 ,
30
+ reason = "The goal of these tests are to test the serving components of our feature" ,
31
+ )
24
32
@patch ("sagemaker.serve.app.threading" )
25
33
@patch ("sagemaker.serve.app.pipeline" )
26
34
def test_in_process_server_init (self , mock_pipeline , mock_threading ):
@@ -30,6 +38,10 @@ def test_in_process_server_init(self, mock_pipeline, mock_threading):
30
38
in_process_server = InProcessServer (model_id = mock_model_id )
31
39
in_process_server ._generator = mock_generator
32
40
41
+ @pytest .mark .skipif (
42
+ PYTHON_VERSION_IS_NOT_310 ,
43
+ reason = "The goal of these test are to test the serving components of our feature" ,
44
+ )
33
45
@patch ("sagemaker.serve.app.logger" )
34
46
@patch ("sagemaker.serve.app.threading" )
35
47
@patch ("sagemaker.serve.app.pipeline" )
@@ -47,6 +59,10 @@ def test_start_server(self, mock_pipeline, mock_threading, mock_logger):
47
59
mock_logger .info .assert_called ()
48
60
mock_thread .start .assert_called ()
49
61
62
+ @pytest .mark .skipif (
63
+ PYTHON_VERSION_IS_NOT_310 ,
64
+ reason = "The goal of these test are to test the serving components of our feature" ,
65
+ )
50
66
@patch ("sagemaker.serve.app.asyncio" )
51
67
@patch ("sagemaker.serve.app.pipeline" )
52
68
def test_start_run_async_in_thread (self , mock_pipeline , mock_asyncio ):
0 commit comments