manim/tests/utils/testing_utils.py
Naveen M K dcb90a8656
Format Imports using Isort (#1178)
* Format imports using Isort.
Add a check for pull requests.

Signed-off-by: Naveen M K <naveen@syrusdark.website>

* CI: update check's name
2021-04-03 13:45:12 +05:30

21 lines
529 B
Python

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,
)