5353FixtureRequest = pytest .FixtureRequest
5454
5555
56+ @pytest .mark .allow_direct_assert
5657def assert_run_main_with_args_error (args : list [str ], capsys : pytest .CaptureFixture [str ], expected_error : str ) -> None :
5758 """Assert that running the CLI exits with code 2 and emits the expected error."""
5859 with pytest .raises (SystemExit ) as exc_info :
@@ -212,6 +213,7 @@ def test_main_keep_model_order_field_references(output_file: Path) -> None:
212213 )
213214
214215
216+ @pytest .mark .allow_direct_assert
215217@pytest .mark .parametrize (
216218 ("target_python_version" , "keep_model_order" , "disable_future_imports" ),
217219 [
@@ -452,6 +454,7 @@ def test_main_jsonschema_multiple_files(output_dir: Path) -> None:
452454 )
453455
454456
457+ @pytest .mark .allow_direct_assert
455458@pytest .mark .benchmark
456459def test_main_jsonschema_no_empty_collapsed_external_model (tmp_path : Path ) -> None :
457460 """Test no empty files with collapsed external models."""
@@ -771,6 +774,7 @@ def test_main_class_name_suffix_with_class_name(output_file: Path) -> None:
771774 )
772775
773776
777+ @pytest .mark .allow_direct_assert
774778def test_main_class_name_prefix_invalid (output_file : Path ) -> None :
775779 """Test that invalid --class-name-prefix is rejected."""
776780 return_code : Exit = main ([
@@ -784,6 +788,7 @@ def test_main_class_name_prefix_invalid(output_file: Path) -> None:
784788 assert return_code == Exit .ERROR
785789
786790
791+ @pytest .mark .allow_direct_assert
787792def test_main_class_name_suffix_invalid (output_file : Path ) -> None :
788793 """Test that invalid --class-name-suffix is rejected."""
789794 return_code : Exit = main ([
@@ -1002,6 +1007,7 @@ def test_main_root_id_jsonschema_with_absolute_local_file(output_file: Path) ->
10021007 )
10031008
10041009
1010+ @pytest .mark .allow_direct_assert
10051011def test_main_url_with_relative_root_id_resolves_relative_refs (mocker : MockerFixture , tmp_path : Path ) -> None :
10061012 """Test --url input keeps resolving relative refs remotely when root $id is path-only."""
10071013 main_response = mocker .Mock ()
@@ -1909,6 +1915,7 @@ def test_main_generate_relative_input_path(output_file: Path) -> None:
19091915 )
19101916
19111917
1918+ @pytest .mark .allow_direct_assert
19121919def test_main_generate_external_absolute_input_path (tmp_path : Path ) -> None :
19131920 """Test helper keeps absolute input paths that are outside the repository root."""
19141921 with tempfile .TemporaryDirectory () as temp_dir :
@@ -2149,6 +2156,7 @@ def test_main_generate_pydantic_v2_dataclass_enum(output_file: Path) -> None:
21492156 )
21502157
21512158
2159+ @pytest .mark .allow_direct_assert
21522160@pytest .mark .parametrize (
21532161 ("input_file" , "expected_file" ),
21542162 [
@@ -2174,6 +2182,7 @@ def test_main_generate_pydantic_v2_model_default_dict(input_file: str, expected_
21742182 assert_file_content (output_file , expected_file )
21752183
21762184
2185+ @pytest .mark .allow_direct_assert
21772186def test_main_generate_from_directory (tmp_path : Path ) -> None :
21782187 """Test generation from directory input."""
21792188 input_ = (JSON_SCHEMA_DATA_PATH / "external_files_in_directory" ).relative_to (Path .cwd ())
@@ -2240,6 +2249,7 @@ def keep_underscores(name: str) -> str:
22402249 )
22412250
22422251
2252+ @pytest .mark .allow_direct_assert
22432253def test_main_http_jsonschema (mocker : MockerFixture , output_file : Path ) -> None :
22442254 """Test HTTP JSON Schema fetching."""
22452255 external_directory = JSON_SCHEMA_DATA_PATH / "external_files_in_directory"
@@ -2351,6 +2361,7 @@ def get_mock_response(url: str, **_: object) -> mocker.Mock:
23512361 assert httpx_get_mock .call_count == 8
23522362
23532363
2364+ @pytest .mark .allow_direct_assert
23542365@pytest .mark .parametrize (
23552366 (
23562367 "headers_arguments" ,
@@ -3304,6 +3315,7 @@ def test_long_description_wrap_string_literal(output_file: Path) -> None:
33043315 )
33053316
33063317
3318+ @pytest .mark .allow_direct_assert
33073319def test_version (capsys : pytest .CaptureFixture ) -> None :
33083320 """Test version output."""
33093321 with pytest .raises (SystemExit ) as e :
@@ -9006,6 +9018,7 @@ def test_field_validators_wrap_mode(output_file: Path, tmp_path: Path) -> None:
90069018 )
90079019
90089020
9021+ @pytest .mark .allow_direct_assert
90099022def test_field_validators_with_no_field_skipped (output_file : Path , tmp_path : Path ) -> None :
90109023 """Test that validators without fields are skipped gracefully."""
90119024 config_file = tmp_path / "no_field_validators_config.json"
@@ -9070,6 +9083,7 @@ def test_field_validators_plain_mode(output_file: Path, tmp_path: Path) -> None:
90709083 )
90719084
90729085
9086+ @pytest .mark .allow_direct_assert
90739087def test_field_validators_all_skipped (output_file : Path , tmp_path : Path ) -> None :
90749088 """Test that when all validators have no fields, output has no validators."""
90759089 config_file = tmp_path / "all_skipped_config.json"
@@ -9267,6 +9281,7 @@ def test_main_circular_ref_external_relative_keywords(output_file: Path) -> None
92679281 )
92689282
92699283
9284+ @pytest .mark .allow_direct_assert
92709285@pytest .mark .benchmark
92719286def test_main_circular_ref_external_url_keywords (mocker : MockerFixture , output_file : Path ) -> None :
92729287 """Test circular external refs with relative paths and schema keywords via URL input."""
0 commit comments