Skip to content

Commit e83960e

Browse files
author
Doug Borg
committed
tests: remove unused var in 3.1 vs 3.0 comparison and tidy comments
1 parent 7e42154 commit e83960e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/test_openapi_31_coverage.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_31_vs_30_feature_comparison(self):
421421
)
422422

423423
# Convert to 3.0 spec and test with 3.0 parser
424-
spec_30_no_const = {
424+
spec_30_no_const = {
425425
"openapi": "3.0.3",
426426
"info": {"title": "Test 3.0", "version": "1.0.0"},
427427
"paths": {},
@@ -435,11 +435,10 @@ def test_31_vs_30_feature_comparison(self):
435435
},
436436
}
437437

438-
from openapi_python_generator.parsers import parse_openapi_30
438+
from openapi_python_generator.parsers import parse_openapi_30
439439

440-
parsed_30 = parse_openapi_30(spec_30_no_const)
440+
parsed_30 = parse_openapi_30(spec_30_no_const)
441441

442-
# In 3.0, const should either not exist or be ignored
443-
test_schema_30 = parsed_30.components.schemas["Test"]
444-
# The 3.0 parser might ignore unknown fields or handle them differently
445-
# This is expected behavior
442+
# In 3.0, const should either not exist or be ignored; ensure schema parses
443+
_ = parsed_30.components.schemas["Test"] # noqa: F841
444+
# 3.0 parser may ignore 3.1-only fields like const (expected)

0 commit comments

Comments
 (0)