Exemple #1
0
 def test_pep257_lint(self):
     if PYTHON26:
         raise SkipTest('PyDocStyle dropped support to Python2.6')
     self._settings['use_pep257'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._settings,
                                 self._check_pep257)
     handler.lint(self._lintable_docstring, '')
Exemple #2
0
 def test_pep8_assignment_operator(self):
     if not PYTHON38:
         raise SkipTest()
     self._settings['pep8'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._settings,
                                 self._check_pep8)
     handler.lint(self._lintable_assignmentoperator)
Exemple #3
0
 def test_pep8_max_line_length(self):
     self._settings['pep8'] = True
     self._settings['pep8_max_line_length'] = 120
     handler = PythonLintHandler('lint', None, 0, 0, self._settings,
                                 self._check_pep8_max_line_length)  # noqa
     handler.lint('a = \'this is a very long string: {0}\'\n'.format(
         'a' * 80))  # noqa
Exemple #4
0
 def test_pep257_ignores(self):
     self._settings['use_pep257'] = True
     self._settings['pep257_ignore'] = [
         'D100', 'D400', 'D209', 'D205', 'D401'
     ]  # noqa
     handler = PythonLintHandler('lint', None, 0, 0,
                                 self._check_pep257_ignores)  # noqa
     handler.lint(self._settings, self._lintable_docstring, '')
Exemple #5
0
 def test_pep257_ignores(self):
     if PYTHON26:
         raise SkipTest('PyDocStyle dropped support to Python2.6')
     self._settings['use_pep257'] = True
     self._settings['pep257_ignore'] = [
         'D100', 'D400', 'D209', 'D205', 'D401', 'D404', 'D213'
     ]  # noqa
     handler = PythonLintHandler('lint', None, 0, 0,
                                 self._check_pep257_ignores)  # noqa
     handler.lint(self._settings, self._lintable_docstring, '')
Exemple #6
0
 def test_mypy(self):
     if not PYTHON3:
         raise SkipTest()
     try:
         import mypy  # noqa
     except ImportError:
         raise SkipTest('MyPy not installed')
     with real_temp_file(self._type_checkable_code) as temp_file_name:
         self._settings['use_mypy'] = True
         handler = PythonLintHandler('lint', None, 0, 0, self._check_mypy)
         handler.lint(self._settings, self._type_checkable_code, temp_file_name)  # noqa
Exemple #7
0
 def test_mypy(self):
     if not PYTHON3:
         raise SkipTest()
     try:
         import mypy  # noqa
     except ImportError:
         raise SkipTest('MyPy not installed')
     with real_temp_file(self._type_checkable_code) as temp_file_name:
         self._settings['use_mypy'] = True
         handler = PythonLintHandler('lint', None, 0, 0, self._check_mypy)
         handler.lint(self._settings, self._type_checkable_code,
                      temp_file_name)  # noqa
Exemple #8
0
 def test_import_validator(self):
     self._settings['validate_imports'] = True
     handler = PythonLintHandler('lint', None, 0, 0,
                                 self._check_validate_imports)  # noqa
     handler.lint(self._settings, self._import_validator_code, '')
Exemple #9
0
 def test_pep8_max_line_lenght(self):
     self._settings['pep8'] = True
     self._settings['pep8_max_line_length'] = 120
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep8_max_line_length)  # noqa
     handler.lint(self._settings, 'a = \'this is a very long string: {0}\'\n'.format('a' * 80))  # noqa
Exemple #10
0
 def test_pep8_ignores(self):
     self._settings['pep8'] = True
     self._settings['pep8_ignore'] = ['W293']
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep8_ignores)  # noqa
     handler.lint(self._settings, self._lintable_code)
Exemple #11
0
 def test_pep8_lint(self):
     self._settings['pep8'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep8)
     handler.lint(self._settings, self._lintable_code)
Exemple #12
0
 def test_import_validator(self):
     self._settings['validate_imports'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._check_validate_imports)  # noqa
     handler.lint(self._settings, self._import_validator_code, '')
Exemple #13
0
 def test_pep257_ignores(self):
     self._settings['use_pep257'] = True
     self._settings['pep257_ignore'] = ['D100', 'D400', 'D209', 'D205', 'D401']  # noqa
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep257_ignores)  # noqa
     handler.lint(self._settings, self._lintable_docstring, '')
Exemple #14
0
 def test_pep257_lint(self):
     self._settings['use_pep257'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep257)
     handler.lint(self._settings, self._lintable_docstring, '')
Exemple #15
0
 def test_pep257_lint(self):
     self._settings['use_pep257'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep257)
     handler.lint(self._settings, self._lintable_docstring, '')
Exemple #16
0
 def test_pyflakes_lint(self):
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pyflakes)
     self._settings['use_pyflakes'] = True
     handler.lint(self._settings, self._lintable_code)
Exemple #17
0
 def test_pyflakes_ignore(self):
     handler = PythonLintHandler('lint', None, 0, 0,
                                 self._check_pyflakes_ignore)  # noqa
     self._settings['use_pyflakes'] = True
     self._settings['pyflakes_ignore'] = 'F841'
Exemple #18
0
 def test_pyflakes_lint(self):
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pyflakes)
     self._settings['use_pyflakes'] = True
     handler.lint(self._settings, self._lintable_code)
Exemple #19
0
 def test_pep8_ignores(self):
     self._settings['pep8'] = True
     self._settings['pep8_ignore'] = ['W293']
     handler = PythonLintHandler('lint', None, 0, 0,
                                 self._check_pep8_ignores)  # noqa
     handler.lint(self._settings, self._lintable_code)
Exemple #20
0
 def test_pep8_lint(self):
     self._settings['pep8'] = True
     handler = PythonLintHandler('lint', None, 0, 0, self._check_pep8)
     handler.lint(self._settings, self._lintable_code)