~aaron-whitehouse/duplicity/bug_932482_trailing_slashes_and_wildcards_error

« back to all changes in this revision

Viewing changes to testing/test_code.py

  • Committer: Kenneth Loafman
  • Date: 2015-01-22 23:38:29 UTC
  • Revision ID: kenneth@loafman.com-20150122233829-njanammpef4hs5dk
* Misc fixes for the following PEP8 issues:
  - 201, 202, 203
  - see http://pep8.readthedocs.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                         'Must set environment var RUN_CODE_TESTS=1')
41
41
    def test_2to3(self):
42
42
        # As we modernize the source code, we can remove more and more nofixes
43
 
        self.run_checker(["2to3",
44
 
                          "--nofix=next",
45
 
                          "--nofix=types",
46
 
                          "--nofix=unicode",
47
 
        # The following fixes we don't want to remove, since they are false
48
 
        # positives, things we don't care about, or real incompatibilities
49
 
        # but which 2to3 can fix for us better automatically.
50
 
                          "--nofix=callable",
51
 
                          "--nofix=dict",
52
 
                          "--nofix=future",
53
 
                          "--nofix=imports",
54
 
                          "--nofix=print",
55
 
                          "--nofix=raw_input",
56
 
                          "--nofix=urllib",
57
 
                          "--nofix=xrange",
58
 
                          _top_dir])
 
43
        self.run_checker([
 
44
            "2to3",
 
45
            "--nofix=next",
 
46
            "--nofix=types",
 
47
            "--nofix=unicode",
 
48
            # The following fixes we don't want to remove, since they are false
 
49
            # positives, things we don't care about, or real incompatibilities
 
50
            # but which 2to3 can fix for us better automatically.
 
51
            "--nofix=callable",
 
52
            "--nofix=dict",
 
53
            "--nofix=future",
 
54
            "--nofix=imports",
 
55
            "--nofix=print",
 
56
            "--nofix=raw_input",
 
57
            "--nofix=urllib",
 
58
            "--nofix=xrange",
 
59
            _top_dir])
59
60
 
60
61
    @unittest.skipUnless(os.getenv('RUN_CODE_TESTS', None) == '1',
61
62
                         'Must set environment var RUN_CODE_TESTS=1')
62
63
    def test_pylint(self):
63
 
        self.run_checker(["pylint",
64
 
                          "-E",
65
 
                          "--msg-template={msg_id}: {line}: {msg}",
66
 
                          "--disable=E0203",  # Access to member before its definition line
67
 
                          "--disable=E0602",  # Undefined variable
68
 
                          "--disable=E0611",  # No name in module
69
 
                          "--disable=E1101",  # Has no member
70
 
                          "--disable=E1103",  # Maybe has no member
71
 
                          "--ignore=_librsync.so",
72
 
                          os.path.join(_top_dir, 'duplicity'),
73
 
                          os.path.join(_top_dir, 'bin/duplicity'),
74
 
                          os.path.join(_top_dir, 'bin/rdiffdir')],
75
 
                         # Allow usage errors, older versions don't have
76
 
                         # --msg-template
77
 
                         [0, 32])
 
64
        self.run_checker([
 
65
            "pylint",
 
66
            "-E",
 
67
            "--msg-template={msg_id}: {line}: {msg}",
 
68
            "--disable=E0203",  # Access to member before its definition line
 
69
            "--disable=E0602",  # Undefined variable
 
70
            "--disable=E0611",  # No name in module
 
71
            "--disable=E1101",  # Has no member
 
72
            "--disable=E1103",  # Maybe has no member
 
73
            "--ignore=_librsync.so",
 
74
            os.path.join(_top_dir, 'duplicity'),
 
75
            os.path.join(_top_dir, 'bin/duplicity'),
 
76
            os.path.join(_top_dir, 'bin/rdiffdir')],
 
77
            # Allow usage errors, older versions don't have
 
78
            # --msg-template
 
79
            [0, 32])
78
80
 
79
81
    @unittest.skipUnless(os.getenv('RUN_CODE_TESTS', None) == '1',
80
82
                         'Must set environment var RUN_CODE_TESTS=1')
84
86
        # and clean up the code.  But for now, let's at least get *some* pep8
85
87
        # coverage.
86
88
        ignores = [
87
 
            "E201",
88
 
            "E202",
89
 
            "E203",
90
89
            "E231",
91
90
            "E241",
92
91
            "E251",