Exemplo n.º 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, '')
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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, '')
Exemplo n.º 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, '')
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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, '')
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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, '')
Exemplo n.º 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, '')
Exemplo n.º 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, '')
Exemplo n.º 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, '')
Exemplo n.º 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)
Exemplo n.º 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'
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)