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:
Diffstat (limited to 'tests/python')
-rw-r--r--tests/python/alembic_export_tests.py18
-rw-r--r--tests/python/bl_alembic_io_test.py1
-rw-r--r--tests/python/bl_animation_fcurves.py1
-rw-r--r--tests/python/bl_blendfile_library_overrides.py8
-rw-r--r--tests/python/bl_pyapi_idprop.py1
-rw-r--r--tests/python/bl_run_operators_event_simulate.py35
-rw-r--r--tests/python/compositor_render_tests.py1
-rw-r--r--tests/python/cycles_render_tests.py1
-rw-r--r--tests/python/modules/mesh_test.py2
-rwxr-xr-xtests/python/modules/render_report.py2
-rw-r--r--tests/python/operators.py2
11 files changed, 53 insertions, 19 deletions
diff --git a/tests/python/alembic_export_tests.py b/tests/python/alembic_export_tests.py
index 9d1738691f0..23a4a376533 100644
--- a/tests/python/alembic_export_tests.py
+++ b/tests/python/alembic_export_tests.py
@@ -197,7 +197,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
def test_hierarchical_export(self, tempdir: pathlib.Path):
abc = tempdir / 'cubes_hierarchical.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
+ "visible_objects_only=True, flatten=False)" % abc.as_posix()
self.run_blender('cubes-hierarchy.blend', script)
# Now check the resulting Alembic file.
@@ -215,7 +215,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
def test_flat_export(self, tempdir: pathlib.Path):
abc = tempdir / 'cubes_flat.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=True)" % abc.as_posix()
+ "visible_objects_only=True, flatten=True)" % abc.as_posix()
self.run_blender('cubes-hierarchy.blend', script)
# Now check the resulting Alembic file.
@@ -236,7 +236,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
def test_hierarchical_export(self, tempdir: pathlib.Path):
abc = tempdir / 'dupligroup_hierarchical.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
+ "visible_objects_only=True, flatten=False)" % abc.as_posix()
self.run_blender('dupligroup-scene.blend', script)
# Now check the resulting Alembic file.
@@ -254,7 +254,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
def test_flat_export(self, tempdir: pathlib.Path):
abc = tempdir / 'dupligroup_hierarchical.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=True)" % abc.as_posix()
+ "visible_objects_only=True, flatten=True)" % abc.as_posix()
self.run_blender('dupligroup-scene.blend', script)
# Now check the resulting Alembic file.
@@ -332,7 +332,7 @@ class CurveExportTest(AbstractAlembicTest):
def test_export_single_curve(self, tempdir: pathlib.Path):
abc = tempdir / 'single-curve.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
+ "visible_objects_only=True, flatten=False)" % abc.as_posix()
self.run_blender('single-curve.blend', script)
# Now check the resulting Alembic file.
@@ -353,7 +353,7 @@ class HairParticlesExportTest(AbstractAlembicTest):
def _do_test(self, tempdir: pathlib.Path, export_hair: bool, export_particles: bool) -> pathlib.Path:
abc = tempdir / 'hair-particles.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=True, visible_objects_only=True, flatten=False, " \
+ "visible_objects_only=True, flatten=False, " \
"export_hair=%r, export_particles=%r, as_background_job=False)" \
% (abc.as_posix(), export_hair, export_particles)
self.run_blender('hair-particles.blend', script)
@@ -419,7 +419,7 @@ class UVMapExportTest(AbstractAlembicTest):
basename = 'T77021-multiple-uvmaps-animated-mesh'
abc = tempdir / f'{basename}.abc'
script = f"import bpy; bpy.ops.wm.alembic_export(filepath='{abc.as_posix()}', start=1, end=1, " \
- f"renderable_only=True, visible_objects_only=True, flatten=False)"
+ f"visible_objects_only=True, flatten=False)"
self.run_blender(f'{basename}.blend', script)
self.maxDiff = 1000
@@ -468,7 +468,7 @@ class LongNamesExportTest(AbstractAlembicTest):
def test_export_long_names(self, tempdir: pathlib.Path):
abc = tempdir / 'long-names.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
- "renderable_only=False, visible_objects_only=False, flatten=False)" % abc.as_posix()
+ "visible_objects_only=False, flatten=False)" % abc.as_posix()
self.run_blender('long-names.blend', script)
name_parts = [
@@ -565,7 +565,7 @@ class InvisibleObjectExportTest(AbstractAlembicTest):
def test_hierarchical_export(self, tempdir: pathlib.Path):
abc = tempdir / 'visibility.abc'
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=2, " \
- "renderable_only=False, visible_objects_only=False)" % abc.as_posix()
+ "visible_objects_only=False)" % abc.as_posix()
self.run_blender('visibility.blend', script)
def test(cube_name: str, expect_visible: bool):
diff --git a/tests/python/bl_alembic_io_test.py b/tests/python/bl_alembic_io_test.py
index 53a0879f160..c0d0bcdea70 100644
--- a/tests/python/bl_alembic_io_test.py
+++ b/tests/python/bl_alembic_io_test.py
@@ -300,7 +300,6 @@ class CameraExportImportTest(unittest.TestCase):
abc_path = self.tempdir / "camera_transforms.abc"
self.assertIn('FINISHED', bpy.ops.wm.alembic_export(
filepath=str(abc_path),
- renderable_only=False,
flatten=flatten,
))
diff --git a/tests/python/bl_animation_fcurves.py b/tests/python/bl_animation_fcurves.py
index 2ec04749d70..9017c1ee037 100644
--- a/tests/python/bl_animation_fcurves.py
+++ b/tests/python/bl_animation_fcurves.py
@@ -40,6 +40,7 @@ class AbstractAnimationTest:
self.assertTrue(self.testdir.exists(),
'Test dir %s should exist' % self.testdir)
+
class FCurveEvaluationTest(AbstractAnimationTest, unittest.TestCase):
def test_fcurve_versioning_291(self):
# See D8752.
diff --git a/tests/python/bl_blendfile_library_overrides.py b/tests/python/bl_blendfile_library_overrides.py
index 48625a1ecdb..c9c89c01cee 100644
--- a/tests/python/bl_blendfile_library_overrides.py
+++ b/tests/python/bl_blendfile_library_overrides.py
@@ -69,7 +69,7 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
assert(len(local_id.override_library.properties) == 1)
override_prop = local_id.override_library.properties[0]
- assert(override_prop.rna_path == "location");
+ assert(override_prop.rna_path == "location")
assert(len(override_prop.operations) == 1)
override_operation = override_prop.operations[0]
assert(override_operation.operation == 'REPLACE')
@@ -96,7 +96,7 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
self.assertIsNone(local_id.data.override_library)
assert(len(local_id.override_library.properties) == 1)
override_prop = local_id.override_library.properties[0]
- assert(override_prop.rna_path == "scale");
+ assert(override_prop.rna_path == "scale")
assert(len(override_prop.operations) == 1)
override_operation = override_prop.operations[0]
assert(override_operation.operation == 'NOOP')
@@ -116,14 +116,14 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
assert(len(local_id.override_library.properties) == 2)
override_prop = local_id.override_library.properties[0]
- assert(override_prop.rna_path == "scale");
+ assert(override_prop.rna_path == "scale")
assert(len(override_prop.operations) == 1)
override_operation = override_prop.operations[0]
assert(override_operation.operation == 'NOOP')
assert(override_operation.subitem_local_index == -1)
override_prop = local_id.override_library.properties[1]
- assert(override_prop.rna_path == "location");
+ assert(override_prop.rna_path == "location")
assert(len(override_prop.operations) == 1)
override_operation = override_prop.operations[0]
assert(override_operation.operation == 'REPLACE')
diff --git a/tests/python/bl_pyapi_idprop.py b/tests/python/bl_pyapi_idprop.py
index 1e570bf9a7f..38cd9d04a6b 100644
--- a/tests/python/bl_pyapi_idprop.py
+++ b/tests/python/bl_pyapi_idprop.py
@@ -140,6 +140,7 @@ class TestIdPropertyCreation(TestHelper, unittest.TestCase):
with self.assertRaises(TypeError):
self.id["a"] = self
+
class TestIdPropertyGroupView(TestHelper, unittest.TestCase):
def test_type(self):
diff --git a/tests/python/bl_run_operators_event_simulate.py b/tests/python/bl_run_operators_event_simulate.py
index 92315d3e853..1cc621b9684 100644
--- a/tests/python/bl_run_operators_event_simulate.py
+++ b/tests/python/bl_run_operators_event_simulate.py
@@ -165,6 +165,16 @@ def gen_events_type_text(text):
yield dict(type=type, value='RELEASE', **kw_extra)
+def repr_action(name, args, kwargs):
+ return "%s(%s)" % (
+ name,
+ ", ".join(
+ [repr(value) for value in args] +
+ [("%s=%r" % (key, value)) for key, value in kwargs.items()]
+ )
+ )
+
+
# -----------------------------------------------------------------------------
# Simulate Events
@@ -505,6 +515,18 @@ def argparse_create():
required=False,
)
+ parser.add_argument(
+ "--time-actions",
+ dest="time_actions",
+ default=False,
+ action="store_true",
+ help=(
+ "Display the time each action takes\n"
+ "(useful for measuring delay between key-presses)."
+ ),
+ required=False,
+ )
+
# Collect doc-strings from static methods in `actions`.
actions_docstring = []
for action_key in ACTION_DIR:
@@ -554,7 +576,7 @@ def setup_default_preferences(prefs):
# Main Function
-def main_event_iter(*, action_list):
+def main_event_iter(*, action_list, time_actions):
"""
Yield all events from action handlers.
"""
@@ -565,9 +587,18 @@ def main_event_iter(*, action_list):
yield dict(type='MOUSEMOVE', value='NOTHING', x=x_init, y=y_init)
+ if time_actions:
+ import time
+ t_prev = time.time()
+
for (op, args, kwargs) in action_list:
yield from handle_action(op, args, kwargs)
+ if time_actions:
+ t = time.time()
+ print("%.4f: %s" % ((t - t_prev), repr_action(op, args, kwargs)))
+ t_prev = t
+
def main():
from sys import argv
@@ -588,7 +619,7 @@ def main():
bpy.app.use_event_simulate = False
run_event_simulate(
- event_iter=main_event_iter(action_list=args.actions),
+ event_iter=main_event_iter(action_list=args.actions, time_actions=args.time_actions),
exit_fn=exit_fn,
)
diff --git a/tests/python/compositor_render_tests.py b/tests/python/compositor_render_tests.py
index 057d4a2e6dd..199e1c13b8e 100644
--- a/tests/python/compositor_render_tests.py
+++ b/tests/python/compositor_render_tests.py
@@ -16,6 +16,7 @@ try:
except ImportError:
inside_blender = False
+
def get_arguments(filepath, output_filepath):
return [
"--background",
diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py
index 36c3f7d9fe5..ca0bc9f18b9 100644
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -57,6 +57,7 @@ BLACKLIST_GPU = [
'transparent_shadow_hair.*.blend',
]
+
def get_arguments(filepath, output_filepath):
dirname = os.path.dirname(filepath)
basedir = os.path.dirname(dirname)
diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py
index 1749e798a32..6d921959e6f 100644
--- a/tests/python/modules/mesh_test.py
+++ b/tests/python/modules/mesh_test.py
@@ -680,7 +680,7 @@ class RunTest:
test_name = each_test.test_name
if self.verbose:
print()
- print("Running test {}/{}: {}...".format(test_number+1, len(self.tests), test_name))
+ print("Running test {}/{}: {}...".format(test_number + 1, len(self.tests), test_name))
success = self.run_test(test_name)
if not success:
diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py
index c1ae0b05fcd..560f8e33585 100755
--- a/tests/python/modules/render_report.py
+++ b/tests/python/modules/render_report.py
@@ -287,7 +287,7 @@ class Report:
-moz-background-size:50px 50px;
background-size:50px 50px;
- -webkit-background-size:50px 51px; /* override value for shitty webkit */
+ -webkit-background-size:50px 51px; /* Override value for silly webkit. */
background-position:0 0, 25px 0, 25px -25px, 0px 25px;
}}
diff --git a/tests/python/operators.py b/tests/python/operators.py
index c209b01c20c..4501df82175 100644
--- a/tests/python/operators.py
+++ b/tests/python/operators.py
@@ -321,7 +321,7 @@ def main():
MeshTest("CubeEdgeUnsubdivide", "testCubeEdgeUnsubdivide", "expectedCubeEdgeUnsubdivide",
[OperatorSpecEditMode("unsubdivide", {}, "EDGE", {i for i in range(6)})]),
MeshTest("UVSphereUnsubdivide", "testUVSphereUnsubdivide", "expectedUVSphereUnsubdivide",
- [OperatorSpecEditMode("unsubdivide", {'iterations': 9}, "FACE", {i for i in range(512)})]),
+ [OperatorSpecEditMode("unsubdivide", {'iterations': 9}, "FACE", {i for i in range(512)})]),
# vert connect path
# Tip: It works only if there is an already existing face or more than 2 vertices.