Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2020-11-12 11:26:20 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-12 11:26:20 +0300
commitde6cee4fc1913982b0b2bd786bfd813c935bbe73 (patch)
treea726c0c63bbd1d6c47c90c32119ce14c8048cddc /tests/python/modules
parente4d432500a0e2f978fe019da43deb843da405032 (diff)
parent88bb29dea668df8cc46aa7f55895f229748bdbb4 (diff)
Merge branch 'master' into codesign_error_tracker
Diffstat (limited to 'tests/python/modules')
-rwxr-xr-xtests/python/modules/global_report.py5
-rw-r--r--tests/python/modules/mesh_test.py20
-rwxr-xr-xtests/python/modules/render_report.py3
3 files changed, 20 insertions, 8 deletions
diff --git a/tests/python/modules/global_report.py b/tests/python/modules/global_report.py
index 8ed8551beb9..f7f181c4736 100755
--- a/tests/python/modules/global_report.py
+++ b/tests/python/modules/global_report.py
@@ -6,6 +6,7 @@ import glob
import os
import pathlib
+
def _write_html(output_dir):
combined_reports = ""
@@ -21,7 +22,7 @@ def _write_html(output_dir):
filepath = os.path.join(output_dir, filename)
combined_reports += pathlib.Path(filepath).read_text()
- combined_reports += "<br/>\n";
+ combined_reports += "<br/>\n"
html = """
<html>
@@ -66,7 +67,7 @@ def add(output_dir, category, name, filepath, failed=None):
name=name,
filepath=filepath)
- dirpath = os.path.join(output_dir, "report", category);
+ dirpath = os.path.join(output_dir, "report", category)
os.makedirs(dirpath, exist_ok=True)
filepath = os.path.join(dirpath, name + ".data")
pathlib.Path(filepath).write_text(html)
diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py
index af0e78257d5..c85e7acf4e8 100644
--- a/tests/python/modules/mesh_test.py
+++ b/tests/python/modules/mesh_test.py
@@ -95,6 +95,7 @@ class PhysicsSpec:
return "Physics Modifier: " + self.modifier_name + " of type " + self.modifier_type + \
" with parameters: " + str(self.modifier_parameters) + " with frame end: " + str(self.frame_end)
+
class OperatorSpec:
"""
Holds one operator and its parameters.
@@ -127,7 +128,14 @@ class MeshTest:
the public method run_test().
"""
- def __init__(self, test_object_name: str, expected_object_name: str, operations_stack=None, apply_modifiers=False, threshold=None):
+ def __init__(
+ self,
+ test_object_name: str,
+ expected_object_name: str,
+ operations_stack=None,
+ apply_modifiers=False,
+ threshold=None,
+ ):
"""
Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name
or test_object_name don't exist.
@@ -258,7 +266,6 @@ class MeshTest:
if self.apply_modifier:
bpy.ops.object.modifier_apply(modifier=modifier_spec.modifier_name)
-
def _bake_current_simulation(self, obj, test_mod_type, test_mod_name, frame_end):
for scene in bpy.data.scenes:
for modifier in obj.modifiers:
@@ -281,7 +288,6 @@ class MeshTest:
print("Created modifier '{}' of type '{}'.".
format(physics_spec.modifier_name, physics_spec.modifier_type))
-
for param_name in physics_spec.modifier_parameters:
try:
setattr(physics_setting, param_name, physics_spec.modifier_parameters[param_name])
@@ -296,11 +302,15 @@ class MeshTest:
scene.frame_set(physics_spec.frame_end + 1)
- self._bake_current_simulation(test_object, physics_spec.modifier_type, physics_spec.modifier_name, physics_spec.frame_end)
+ self._bake_current_simulation(
+ test_object,
+ physics_spec.modifier_type,
+ physics_spec.modifier_name,
+ physics_spec.frame_end,
+ )
if self.apply_modifier:
bpy.ops.object.modifier_apply(modifier=physics_spec.modifier_name)
-
def _apply_operator(self, test_object, operator: OperatorSpec):
"""
Apply operator on test object.
diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py
index b6cafc2ee24..832d3849f01 100755
--- a/tests/python/modules/render_report.py
+++ b/tests/python/modules/render_report.py
@@ -31,9 +31,10 @@ COLORS = COLORS_DUMMY
# NOTE: Keep everything lowercase.
BLACKLIST = (
- # 'file_to_blacklist.blend',
+ # 'file_to_blacklist.blend',
)
+
def print_message(message, type=None, status=''):
if type == 'SUCCESS':
print(COLORS.GREEN, end="")