diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 07:58:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 07:58:34 +0300 |
commit | 00fc1d70a70694973c53d4974ed21ef888532d0a (patch) | |
tree | 5c40fa7d2a915c764b244fbed591fae5b4072a74 /tests/python/modules | |
parent | e856eb7e8b65a7391c89b0938de49bb7d781f5dc (diff) | |
parent | 8c15d612a5cdfe39233c7f2b7556742091c82558 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'tests/python/modules')
-rwxr-xr-x | tests/python/modules/render_report.py | 20 | ||||
-rwxr-xr-x | tests/python/modules/test_utils.py | 3 |
2 files changed, 11 insertions, 12 deletions
diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index 425e6d59fa0..1f0022f13b6 100755 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -23,6 +23,7 @@ class COLORS_DUMMY: GREEN = '' ENDC = '' + COLORS = COLORS_DUMMY @@ -55,10 +56,12 @@ def blend_list(dirpath): filepath = os.path.join(dirpath, filename) yield filepath + def test_get_name(filepath): filename = os.path.basename(filepath) return os.path.splitext(filename)[0] + def test_get_images(output_dir, filepath, reference_dir): testname = test_get_name(filepath) dirpath = os.path.dirname(filepath) @@ -99,7 +102,7 @@ class Report: 'passed_tests', 'compare_tests', 'compare_engines' - ) + ) def __init__(self, title, output_dir, idiff): self.title = title @@ -158,7 +161,7 @@ class Report: filepath = os.path.join(outdir, "compare.data") pathlib.Path(filepath).write_text(self.compare_tests) - def _write_html(self, comparison = False): + def _write_html(self, comparison=False): # Gather intermediate data for all tests. if comparison: failed_data = [] @@ -307,7 +310,6 @@ class Report: self.compare_tests += test_html - def _diff_output(self, filepath, tmp_filepath): old_img, ref_img, new_img, diff_img = test_get_images(self.output_dir, filepath, self.reference_dir) @@ -330,7 +332,7 @@ class Report: "-failpercent", "1", ref_img, tmp_filepath, - ) + ) try: subprocess.check_output(command) failed = False @@ -357,7 +359,7 @@ class Report: "-abs", "-scale", "16", ref_img, tmp_filepath - ) + ) try: subprocess.check_output(command) @@ -367,7 +369,6 @@ class Report: return not failed - def _run_test(self, filepath, render_cb): testname = test_get_name(filepath) print_message(testname, 'SUCCESS', 'RUN') @@ -394,7 +395,7 @@ class Report: return error elif error == "NO_START": print_message('Can not perform tests because blender fails to start.', - 'Make sure INSTALL target was run.') + 'Make sure INSTALL target was run.') return error elif error == 'VERIFY': print_message("Rendered result is different from reference image") @@ -404,7 +405,6 @@ class Report: 'FAILURE', 'FAILED') return error - def _run_all_tests(self, dirname, dirpath, render_cb): passed_tests = [] failed_tests = [] @@ -437,8 +437,8 @@ class Report: 'SUCCESS', 'PASSED') if failed_tests: print_message("{} tests, listed below:" . - format(len(failed_tests)), - 'FAILURE', 'FAILED') + format(len(failed_tests)), + 'FAILURE', 'FAILED') failed_tests.sort() for test in failed_tests: print_message("{}" . format(test), 'FAILURE', "FAILED") diff --git a/tests/python/modules/test_utils.py b/tests/python/modules/test_utils.py index 2b762b4122c..47d720684ba 100755 --- a/tests/python/modules/test_utils.py +++ b/tests/python/modules/test_utils.py @@ -62,7 +62,6 @@ class AbstractBlenderRunnerTest(unittest.TestCase): blender: pathlib.Path = None testdir: pathlib.Path = None - def run_blender(self, filepath: str, python_script: str, timeout: int=300) -> str: """Runs Blender by opening a blendfile and executing a script. @@ -92,7 +91,7 @@ class AbstractBlenderRunnerTest(unittest.TestCase): '-E', 'CYCLES', '--python-exit-code', '47', '--python-expr', python_script, - ] + ] ) proc = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, |