1515
1616
1717def _compare_directories (
18+ * ,
1819 record : Path ,
1920 test_subject : Path ,
2021 expected_differences : dict [Path , str ] | None = None ,
@@ -59,8 +60,8 @@ def _compare_directories(
5960
6061 for sub_path in dc .common_dirs :
6162 _compare_directories (
62- record / sub_path ,
63- test_subject / sub_path ,
63+ record = record / sub_path ,
64+ test_subject = test_subject / sub_path ,
6465 expected_differences = expected_differences ,
6566 ignore = ignore ,
6667 depth = depth + 1 ,
@@ -80,7 +81,7 @@ def run_e2e_test(
8081 * ,
8182 golden_record_path : str | None = None ,
8283) -> Result :
83- with generate_client (openapi_document , extra_args , output_path ) as g :
84+ with generate_client (openapi_document = openapi_document , extra_args = extra_args , output_path = output_path ) as g :
8485 if golden_record_path :
8586 gr_path = Path (__file__ ).parent / "golden-records" / golden_record_path
8687 else :
@@ -90,7 +91,10 @@ def run_e2e_test(
9091 # Use absolute paths for expected differences for easier comparisons
9192 expected_differences = {g .output_path .joinpath (key ): value for key , value in expected_differences .items ()}
9293 _compare_directories (
93- gr_path , g .output_path , expected_differences = expected_differences , expected_missing = expected_missing
94+ record = gr_path ,
95+ test_subject = g .output_path ,
96+ expected_differences = expected_differences ,
97+ expected_missing = expected_missing ,
9498 )
9599
96100 result = subprocess .run (
@@ -146,7 +150,7 @@ def test_escapes_end_to_end():
146150)
147151def test_meta (meta : str , generated_file : str | None , expected_file : str | None ):
148152 with generate_client (
149- "3.1_specific.openapi.yaml" ,
153+ openapi_document = "3.1_specific.openapi.yaml" ,
150154 extra_args = [f"--meta={ meta } " ],
151155 output_path = "test-3-1-features-client" ,
152156 ) as g :
@@ -220,7 +224,7 @@ def test_bad_url():
220224@pytest .mark .parametrize ("document" , ERROR_DOCUMENTS , ids = [path .stem for path in ERROR_DOCUMENTS ])
221225def test_documents_with_errors (snapshot , document ):
222226 with generate_client (
223- document ,
227+ openapi_document = document ,
224228 extra_args = ["--fail-on-warning" ],
225229 output_path = "test-documents-with-errors" ,
226230 raise_on_error = False ,
@@ -234,8 +238,8 @@ def test_documents_with_errors(snapshot, document):
234238def test_custom_post_hooks ():
235239 config_path = Path (__file__ ).parent / "custom_post_hooks.config.yml"
236240 with generate_client (
237- "baseline_openapi_3.0.json" ,
238- [f"--config={ config_path } " ],
241+ openapi_document = "baseline_openapi_3.0.json" ,
242+ extra_args = [f"--config={ config_path } " ],
239243 raise_on_error = False ,
240244 ) as g :
241245 assert g .generator_result .exit_code == 1
@@ -271,7 +275,7 @@ def test_update_integration_tests():
271275 url = url ,
272276 config_path = config_path ,
273277 )
274- _compare_directories (source_path , temp_dir , ignore = ["pyproject.toml" ])
278+ _compare_directories (record = source_path , test_subject = temp_dir , ignore = ["pyproject.toml" ])
275279 result = subprocess .run (
276280 [sys .executable , "-m" , "mypy" , str (temp_dir ), "--strict" ],
277281 capture_output = True ,
0 commit comments