Changeset View
Changeset View
Standalone View
Standalone View
tests/python/modules/test_utils.py
| Show All 40 Lines | class AbstractBlenderRunnerTest(unittest.TestCase): | ||||
| blender: pathlib.Path = None | blender: pathlib.Path = None | ||||
| testdir: pathlib.Path = None | testdir: pathlib.Path = None | ||||
| def run_blender(self, filepath: str, python_script: str, timeout: int = 300) -> str: | def run_blender(self, filepath: str, python_script: str, timeout: int = 300) -> str: | ||||
| """Runs Blender by opening a blendfile and executing a script. | """Runs Blender by opening a blendfile and executing a script. | ||||
| Returns Blender's stdout + stderr combined into one string. | Returns Blender's stdout + stderr combined into one string. | ||||
| :param filepath: taken relative to self.testdir. | :arg filepath: taken relative to self.testdir. | ||||
| :param timeout: in seconds | :arg timeout: in seconds | ||||
| """ | """ | ||||
| assert self.blender, "Path to Blender binary is to be set in setUpClass()" | assert self.blender, "Path to Blender binary is to be set in setUpClass()" | ||||
| assert self.testdir, "Path to tests binary is to be set in setUpClass()" | assert self.testdir, "Path to tests binary is to be set in setUpClass()" | ||||
| blendfile = self.testdir / filepath if filepath else "" | blendfile = self.testdir / filepath if filepath else "" | ||||
| command = [ | command = [ | ||||
| Show All 25 Lines | |||||