Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove old validation check
  • Loading branch information
mateuszdrwal committed Jun 2, 2024
commit 4d93d5fbffb4814eb9f09ffb662e4724ea830d2c
15 changes: 0 additions & 15 deletions manim_slides/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,6 @@ def start_animation_is_before_end(

return pre_slide_config

@model_validator(mode="after")
@classmethod
def loop_and_auto_next_disallowed(
cls, pre_slide_config: "PreSlideConfig"
) -> "PreSlideConfig":
if pre_slide_config.loop and pre_slide_config.auto_next:
raise ValueError(
"You cannot have both `loop=True` and `auto_next=True`, "
"because a looping slide has no ending. "
"This may be supported in the future if "
"https://github.com/jeertmans/manim-slides/pull/299 gets merged."
)

return pre_slide_config

@property
def slides_slice(self) -> slice:
return slice(self.start_animation, self.end_animation)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def construct(self) -> None:
assert not self._base_slide_config.auto_next

@assert_constructs
class TestLoopAndAutoNextFails(Slide):
class TestLoopAndAutoNextSucceeds(Slide):
def construct(self) -> None:
text = Text("Some text")

Expand All @@ -202,8 +202,7 @@ def construct(self) -> None:
self.next_slide(loop=True, auto_next=True)
self.play(text.animate.scale(2))

with pytest.raises(ValidationError):
self.next_slide()
self.next_slide()

@assert_constructs
class TestPlaybackRate(Slide):
Expand Down