diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 07:47:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 07:55:02 +0300 |
commit | 8c15d612a5cdfe39233c7f2b7556742091c82558 (patch) | |
tree | 248e7611f9245c1796515baef2ace410bf896c9d /tests/python/modules | |
parent | b66aa0b0a6b123e833d4038a77a5d3f04c37a9a0 (diff) |
Cleanup: pep8
Diffstat (limited to 'tests/python/modules')
-rwxr-xr-x | tests/python/modules/render_report.py | 18 | ||||
-rwxr-xr-x | tests/python/modules/test_utils.py | 3 |
2 files changed, 10 insertions, 11 deletions
diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index 67c1108941d..6c71e8dcb74 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): testname = test_get_name(filepath) dirpath = os.path.dirname(filepath) @@ -96,7 +99,7 @@ class Report: 'update', 'failed_tests', 'passed_tests' - ) + ) def __init__(self, title, output_dir, idiff): self.title = title @@ -257,7 +260,6 @@ class Report: else: self.passed_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) @@ -280,7 +282,7 @@ class Report: "-failpercent", "1", ref_img, tmp_filepath, - ) + ) try: subprocess.check_output(command) failed = False @@ -307,7 +309,7 @@ class Report: "-abs", "-scale", "16", ref_img, tmp_filepath - ) + ) try: subprocess.check_output(command) @@ -317,7 +319,6 @@ class Report: return not failed - def _run_test(self, filepath, render_cb): testname = test_get_name(filepath) print_message(testname, 'SUCCESS', 'RUN') @@ -344,7 +345,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") @@ -354,7 +355,6 @@ class Report: 'FAILURE', 'FAILED') return error - def _run_all_tests(self, dirname, dirpath, render_cb): passed_tests = [] failed_tests = [] @@ -387,8 +387,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, |