2828@pytest .fixture
2929def sample_entrypoint ():
3030 """Create a temporary entrypoint file with a function."""
31- with tempfile .NamedTemporaryFile (
32- mode = "w" , suffix = ".py" , delete = False
33- ) as temp_file :
31+ with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".py" , delete = False ) as temp_file :
3432 entrypoint_content = textwrap .dedent (
3533 """
3634 from typing import List
@@ -62,9 +60,7 @@ def function(request: SampleRequest) -> SampleResponse:
6260@pytest .fixture
6361def entrypoint_no_annotations ():
6462 """Create an entrypoint with no type annotations."""
65- with tempfile .NamedTemporaryFile (
66- mode = "w" , suffix = ".py" , delete = False
67- ) as temp_file :
63+ with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".py" , delete = False ) as temp_file :
6864 entrypoint_content = textwrap .dedent (
6965 """
7066 def function(request):
@@ -117,6 +113,7 @@ def test_inspect_function_types_static(sample_entrypoint, entrypoint_no_annotati
117113 assert req_name is None
118114 assert resp_name is None
119115
116+
120117def test_inspect_function_types (sample_entrypoint ):
121118 """Test dynamic inspection of function types."""
122119 req_name , resp_name = function_utils .inspect_function_types (sample_entrypoint )
@@ -139,7 +136,7 @@ def test_get_request_type(sample_entrypoint, entrypoint_no_annotations):
139136
140137
141138def test_generate_test_json ():
142- """Test generating test.json file from entrypoint with simple and complex nested types."""
139+ """Test generating test.json with simple and complex nested types."""
143140 temp_dir = tempfile .mkdtemp ()
144141 models_file = os .path .join (temp_dir , "test_models.py" )
145142
@@ -235,4 +232,4 @@ def function(request: ComplexRequest):
235232 if temp_dir in sys .path :
236233 sys .path .remove (temp_dir )
237234 if os .path .exists (temp_dir ):
238- shutil .rmtree (temp_dir )
235+ shutil .rmtree (temp_dir )
0 commit comments