Skip to content

Commit

Permalink
Improve test to make sure random is correctly set
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Aug 14, 2024
1 parent 6897ea0 commit d83c8ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/module/scene/test_scene.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations

import datetime
import random

import numpy as np
import pytest

from manim import Circle, FadeIn, Group, Mobject, Scene, Square
Expand Down Expand Up @@ -113,7 +115,13 @@ def __init__(self):

good = GoodScene()
assert good.random_seed == 3
random_random = random.random()
np_random = np.random.random()

with pytest.warns(FutureWarning):
bad = BadScene()
assert bad.random_seed == 3

# check that they both actually set the seed
assert random.random() == random_random
assert np.random.random() == np_random

0 comments on commit d83c8ea

Please sign in to comment.