@@ -4273,6 +4273,7 @@ def test_composable_tutorial_errors() -> None:
42734273 MissingChild ,
42744274 ]
42754275
4276+ # below test has mismatch of options and default ids (defaults has more ids than options)
42764277 with make_test (
42774278 {
42784279 Path (
@@ -4288,10 +4289,35 @@ def test_composable_tutorial_errors() -> None:
42884289 }
42894290 ) as result :
42904291 diagnostics = result .diagnostics [FileId ("index.txt" )]
4291- assert len (diagnostics ) == 1
4292- assert [type (d ) for d in diagnostics ] == [
4293- InvalidChildCount ,
4294- ]
4292+ assert len (diagnostics ) >= 1
4293+ invalidChildError = next (
4294+ (d for d in diagnostics if isinstance (d , InvalidChildCount )), None
4295+ )
4296+ assert invalidChildError
4297+ assert "defaults" in invalidChildError .message
4298+
4299+ # below test has mismatch of options and default ids (defaults has less ids than options)
4300+ with make_test (
4301+ {
4302+ Path (
4303+ "source/index.txt"
4304+ ): """
4305+ .. composable-tutorial::
4306+ :options: interface, language, cluster-topology
4307+ :defaults: driver, None, repl, gcp
4308+
4309+ .. selected-content::
4310+ :selections: driver, None, repl, gcp
4311+ """
4312+ }
4313+ ) as result :
4314+ diagnostics = result .diagnostics [FileId ("index.txt" )]
4315+ assert len (diagnostics ) >= 1
4316+ invalidChildError = next (
4317+ (d for d in diagnostics if isinstance (d , InvalidChildCount )), None
4318+ )
4319+ assert invalidChildError
4320+ assert "defaults" in invalidChildError .message
42954321
42964322
42974323def test_composable_headings () -> None :
0 commit comments