diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-26 01:26:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-26 01:26:15 +0300 |
commit | cb66a28d821906957a8f092b999f531e4a3a4571 (patch) | |
tree | 6faf2c490f77e20f87a12bec9f16d505f3ff8356 /tests | |
parent | 24c383cfc4762c29527f70bbcf32a553ab035af2 (diff) |
Cleanup: unused vars, imports
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/python/alembic_tests.py | 10 | ||||
-rw-r--r-- | tests/python/batch_import.py | 2 | ||||
-rw-r--r-- | tests/python/bl_alembic_import_test.py | 3 | ||||
-rw-r--r-- | tests/python/bl_load_addons.py | 2 | ||||
-rw-r--r-- | tests/python/bl_load_py_modules.py | 2 | ||||
-rw-r--r-- | tests/python/bl_mesh_validate.py | 2 | ||||
-rw-r--r-- | tests/python/bl_run_operators.py | 4 | ||||
-rwxr-xr-x | tests/python/ffmpeg_tests.py | 4 | ||||
-rwxr-xr-x | tests/python/modules/test_utils.py | 3 | ||||
-rw-r--r-- | tests/python/pep8.py | 2 | ||||
-rw-r--r-- | tests/python/rna_info_dump.py | 4 |
11 files changed, 13 insertions, 25 deletions
diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py index d872e699cea..09e9b8981e3 100755 --- a/tests/python/alembic_tests.py +++ b/tests/python/alembic_tests.py @@ -20,17 +20,15 @@ # <pep8 compliant> import argparse -import functools -import shutil import pathlib import subprocess import sys -import tempfile import unittest -from modules.test_utils import (with_tempdir, - AbstractBlenderRunnerTest, - ) +from modules.test_utils import ( + with_tempdir, + AbstractBlenderRunnerTest, +) class AbcPropError(Exception): diff --git a/tests/python/batch_import.py b/tests/python/batch_import.py index a6e2469349b..20d96a69a79 100644 --- a/tests/python/batch_import.py +++ b/tests/python/batch_import.py @@ -157,7 +157,7 @@ def main(): parser.add_option("-S", "--start", dest="start", help="From collected files, start with this index", metavar='int') parser.add_option("-E", "--end", dest="end", help="From collected files, end with this index", metavar='int') - options, args = parser.parse_args(argv) # In this example we wont use the args + options, _args = parser.parse_args(argv) # In this example we wont use the args if not argv: parser.print_help() diff --git a/tests/python/bl_alembic_import_test.py b/tests/python/bl_alembic_import_test.py index 95afff53ed4..ad7d2fd398a 100644 --- a/tests/python/bl_alembic_import_test.py +++ b/tests/python/bl_alembic_import_test.py @@ -175,8 +175,6 @@ class SimpleImportTest(AbstractAlembicTest): self.assertAlmostEqual(z, 0) def test_change_path_modifier(self): - import math - fname = 'animated-mesh.abc' abc = self.testdir / fname relpath = bpy.path.relpath(str(abc)) @@ -188,7 +186,6 @@ class SimpleImportTest(AbstractAlembicTest): # Check that the file loaded ok. bpy.context.scene.frame_set(6) scene = bpy.context.scene - layer = scene.view_layers[scene.active_layer] mesh = plane.to_mesh(bpy.context.depsgraph, True, True, False) self.assertAlmostEqual(-1, mesh.vertices[0].co.x) self.assertAlmostEqual(-1, mesh.vertices[0].co.y) diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py index 16ddea24756..e404e2340ce 100644 --- a/tests/python/bl_load_addons.py +++ b/tests/python/bl_load_addons.py @@ -102,7 +102,7 @@ def reload_addons(do_reload=True, do_reverse=True): disable_addons() # Run twice each time. - for i in (0, 1): + for _ in (0, 1): for mod in modules: mod_name = mod.__name__ print("\tenabling:", mod_name) diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py index 437a425a36d..b7b0db76b63 100644 --- a/tests/python/bl_load_py_modules.py +++ b/tests/python/bl_load_py_modules.py @@ -197,7 +197,7 @@ def load_modules(): assert(os.path.samefile(mod_imp.__file__, submod_full)) modules.append(mod_imp) - except Exception as e: + except Exception: import traceback # Module might fail to import, but we don't want whole test to fail here. # Reasoning: diff --git a/tests/python/bl_mesh_validate.py b/tests/python/bl_mesh_validate.py index e1dd097b2e0..47a5e5efe47 100644 --- a/tests/python/bl_mesh_validate.py +++ b/tests/python/bl_mesh_validate.py @@ -114,7 +114,7 @@ def test_builtins(): getattr(bpy.ops.mesh, func)(location=(x * 2.5, y * 2.5, 0)) data = bpy.context.active_object.data try: - for n in range(BUILTINS_NBRCHANGES): + for _ in range(BUILTINS_NBRCHANGES): rnd = random.randint(1, 3) if rnd == 1: # Make fun with some edge. diff --git a/tests/python/bl_run_operators.py b/tests/python/bl_run_operators.py index f3b1ec2f4c2..5954f7d9381 100644 --- a/tests/python/bl_run_operators.py +++ b/tests/python/bl_run_operators.py @@ -141,7 +141,7 @@ def reset_blend(): if USE_RANDOM_SCREEN: import random - for i in range(random.randint(0, len(bpy.data.screens))): + for _ in range(random.randint(0, len(bpy.data.screens))): bpy.ops.screen.delete() print("Scree IS", bpy.context.screen) @@ -237,7 +237,7 @@ if USE_ATTRSET: seq = getattr(bpy.data, attr) if seq.__class__.__name__ == 'bpy_prop_collection': for id_data in seq: - for val, prop, tp in id_walk(id_data, bpy.data): + for val, prop, _tp in id_walk(id_data, bpy.data): # print(id_data) for val_rnd in _random_values: try: diff --git a/tests/python/ffmpeg_tests.py b/tests/python/ffmpeg_tests.py index 70677677667..3d38ebd5edc 100755 --- a/tests/python/ffmpeg_tests.py +++ b/tests/python/ffmpeg_tests.py @@ -20,12 +20,8 @@ # <pep8 compliant> import argparse -import functools -import shutil import pathlib -import subprocess import sys -import tempfile import unittest from modules.test_utils import AbstractBlenderRunnerTest diff --git a/tests/python/modules/test_utils.py b/tests/python/modules/test_utils.py index 47d720684ba..46c1626493f 100755 --- a/tests/python/modules/test_utils.py +++ b/tests/python/modules/test_utils.py @@ -19,13 +19,10 @@ # <pep8 compliant> -import argparse import functools import shutil import pathlib -import re import subprocess -import sys import tempfile import unittest diff --git a/tests/python/pep8.py b/tests/python/pep8.py index ccc2dddbbd9..78f0c82d00f 100644 --- a/tests/python/pep8.py +++ b/tests/python/pep8.py @@ -62,7 +62,7 @@ def is_pep8(path): return 1 f = open(path, 'r', encoding="utf8") - for i in range(PEP8_SEEK_COMMENT): + for _ in range(PEP8_SEEK_COMMENT): line = f.readline() if line.startswith("# <pep8"): if line.startswith("# <pep8 compliant>"): diff --git a/tests/python/rna_info_dump.py b/tests/python/rna_info_dump.py index da228e52652..01cbe8d290b 100644 --- a/tests/python/rna_info_dump.py +++ b/tests/python/rna_info_dump.py @@ -71,7 +71,7 @@ def api_dump(use_properties=True, use_functions=True): def dump_funcs(): data = [] - for struct_id, v in sorted(struct.items()): + for _struct_id, v in sorted(struct.items()): struct_id_str = struct_full_id(v) funcs = [(func.identifier, func) for func in v.functions] @@ -90,7 +90,7 @@ def api_dump(use_properties=True, use_functions=True): def dump_props(): data = [] - for struct_id, v in sorted(struct.items()): + for _struct_id, v in sorted(struct.items()): struct_id_str = struct_full_id(v) props = [(prop.identifier, prop) for prop in v.properties] |