manim/tests/utils/testing_utils.py
Darylgolden 6018ebf445 Revert "Merge branch 'main' of https://github.com/ManimCommunity/manim"
This reverts commit e7f9d23aa7, reversing
changes made to afe91d02b6.
2023-07-31 15:29:39 +08:00

23 lines
565 B
Python

from __future__ import annotations
import inspect
import sys
def get_scenes_to_test(module_name):
"""Get all Test classes of the module from which it is called. Used to fetch all the SceneTest of the module.
Parameters
----------
module_name : :class:`str`
The name of the module tested.
Returns
-------
List[:class:`type`]
The list of all the classes of the module.
"""
return inspect.getmembers(
sys.modules[module_name],
lambda m: inspect.isclass(m) and m.__module__ == module_name,
)