Skip to content

Commit

Permalink
fix(tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Dec 10, 2024
1 parent e2e9a96 commit 2f8f040
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions tests/test_slide.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random
import shutil
import sys
from pathlib import Path
from typing import Any, Union

Expand All @@ -24,23 +25,46 @@
from manim_slides.defaults import FOLDER_PATH
from manim_slides.render import render
from manim_slides.slide.manim import Slide as CESlide
from manim_slides.slide.manimlib import Slide as GLSlide

if sys.version_info < (3, 10):

class _GLSlide:
def construct(self) -> None:
pass

def render(self) -> None:
pass

GLSlide = pytest.param(
_GLSlide,
marks=pytest.mark.skip(reason="See https://github.com/3b1b/manim/issues/2263"),
)
else:
from manim_slides.slide.manimlib import Slide as GLSlide

_GLSlide = GLSlide


class CEGLSlide(CESlide):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, renderer=OpenGLRenderer(), **kwargs)


SlideType = Union[type[CESlide], type[GLSlide], type[CEGLSlide]]
Slide = Union[CESlide, GLSlide, CEGLSlide]
SlideType = Union[type[CESlide], type[_GLSlide], type[CEGLSlide]]
Slide = Union[CESlide, _GLSlide, CEGLSlide]


@pytest.mark.parametrize(
"renderer",
[
"--CE",
"--GL",
pytest.param(
"--GL",
marks=pytest.mark.skipif(
sys.version_info < (3, 10),
reason="See https://github.com/3b1b/manim/issues/2263",
),
),
],
)
def test_render_basic_slide(
Expand Down Expand Up @@ -143,7 +167,13 @@ def test_clear_cache(
"renderer",
[
"--CE",
"--GL",
pytest.param(
"--GL",
marks=pytest.mark.skipif(
sys.version_info < (3, 10),
reason="See https://github.com/3b1b/manim/issues/2263",
),
),
],
)
@pytest.mark.parametrize(
Expand Down

0 comments on commit 2f8f040

Please sign in to comment.