@@ -744,7 +744,11 @@ def test_indexing_observes_the_override(self) -> None:
744744 def test_a_contiguous_space_refuses_indexing_with_or_without_the_override (self ) -> None :
745745 """Pre-existing behaviour the override does not change: openjd-model requires
746746 sequential iteration for contiguous chunking, so ``get`` always declines.
747- Pinned here so a future change to random access is a deliberate one."""
747+ Pinned here so a future change to random access is a deliberate one. Its
748+ counterpart is ``test_known_gaps.py::test_a_contiguous_chunked_space_supports_indexing``,
749+ a strict xfail asserting the opposite: closing that gap fails there as an xpass
750+ *and* here as a hard assertion, so both move together, along with the
751+ limitation noted in ``specs/python-model-interface.md``."""
748752 for override in (None , 1 ):
749753 it = StepParameterSpaceIterator (
750754 step = self ._step (self ._STATIC ), chunks_task_count_override = override
@@ -778,6 +782,17 @@ def test_override_turns_adaptive_chunking_off(self) -> None:
778782 assert len (overridden ) == 10
779783 assert self ._frames (overridden ) == [f"{ n } -{ n } " for n in range (1 , 11 )]
780784
785+ def test_a_non_positive_override_is_rejected_even_when_it_would_be_ignored (self ) -> None :
786+ """The validation runs before the space is inspected, so an unchunked space still
787+ rejects 0 rather than silently discarding it. The reference does not validate at
788+ all; this is the documented divergence, pinned so it stays deliberate."""
789+ space = StepParameterSpace (
790+ taskParameterDefinitions = {"Frame" : {"type" : "INT" , "range" : [1 , 2 , 3 ]}}
791+ )
792+ with pytest .raises (ValueError ) as excinfo :
793+ StepParameterSpaceIterator (space = space , chunks_task_count_override = 0 )
794+ assert str (excinfo .value ) == "chunks_task_count_override must be a positive integer."
795+
781796 def test_override_is_ignored_when_the_space_has_no_chunked_parameter (self ) -> None :
782797 """Reference behaviour: the override only applies to a space that chunks."""
783798 space = StepParameterSpace (
0 commit comments