From bf010c4a15840964ec92912e5582095d029bc314 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 7 Jun 2015 13:54:13 +1000 Subject: Cleanup: pep8 --- tests/python/bl_run_operators.py | 2 +- tests/python/pep8.py | 13 ++++++++++++- tests/python/rst_to_doctree_mini.py | 21 +++++++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/python/bl_run_operators.py b/tests/python/bl_run_operators.py index d511cd19ff7..f3c553cf3ef 100644 --- a/tests/python/bl_run_operators.py +++ b/tests/python/bl_run_operators.py @@ -163,7 +163,7 @@ if USE_ATTRSET: if issubclass(cls, skip_classes): continue - ## to support skip-save we cant get all props + # # to support skip-save we cant get all props # properties = cls.bl_rna.properties.keys() properties = [] for prop_id, prop in cls.bl_rna.properties.items(): diff --git a/tests/python/pep8.py b/tests/python/pep8.py index 551e2a87e9b..0d6db729767 100644 --- a/tests/python/pep8.py +++ b/tests/python/pep8.py @@ -117,7 +117,18 @@ def main(): # these are very picky and often hard to follow # while keeping common script formatting. - ignore = "E122", "E123", "E124", "E125", "E126", "E127", "E128" + ignore = ( + "E122", + "E123", + "E124", + "E125", + "E126", + "E127", + "E128", + # "imports not at top of file." + # prefer to load as needed (lazy load addons etc). + "E402", + ) for f, pep8_type in files: diff --git a/tests/python/rst_to_doctree_mini.py b/tests/python/rst_to_doctree_mini.py index 6a885a108f8..dfc6cd57db6 100644 --- a/tests/python/rst_to_doctree_mini.py +++ b/tests/python/rst_to_doctree_mini.py @@ -28,13 +28,14 @@ import collections -Directive = collections.namedtuple('Directive', - ("type", - "value", - "value_strip", - "line", - "indent", - "members")) +Directive = collections.namedtuple( + "Directive", + ("type", + "value", + "value_strip", + "line", + "indent", + "members")) def parse_rst_py(filepath): @@ -80,7 +81,7 @@ def parse_rst_py(filepath): return tree[0] -if __name__ == "__main__": +def main(): # not intended use, but may as well print rst files passed as a test. import sys for arg in sys.argv: @@ -88,3 +89,7 @@ if __name__ == "__main__": items = parse_rst_py(arg) for i in items: print(i) + + +if __name__ == "__main__": + main() -- cgit v1.2.3