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, '')
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)
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
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, '')
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, '')
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
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, '')
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
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)
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)
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, '')
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, '')
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)
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'