Hello community,
here is the log from the commit of package python-salt-testing for
openSUSE:Factory checked in at 2013-10-25 11:31:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-salt-testing (Old)
and /work/SRC/openSUSE:Factory/.python-salt-testing.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-salt-testing"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-salt-testing/python-salt-testing.changes
2013-10-01 08:33:22.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python-salt-testing.new/python-salt-testing.changes
2013-10-25 11:31:14.000000000 +0200
@@ -1,0 +2,15 @@
+Thu Oct 24 15:57:58 UTC 2013 - [email protected]
+
+- Updated to version 0.5.2
+ - no-encoding-in-empty-file (W9905) test added
+ - only apply PEP8 messages which generate code
+ - Log start and stop executions
+ - Logic added to avoid PyLints deprecation messages
+ - AUTHORS.rst and LICENSE added
+
+-------------------------------------------------------------------
+Thu Oct 24 11:13:35 UTC 2013 - [email protected]
+
+- Require python-setuptools instead of distribute (upstreams merged)
+
+-------------------------------------------------------------------
Old:
----
SaltTesting-0.5.1.tar.gz
New:
----
SaltTesting-0.5.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-salt-testing.spec ++++++
--- /var/tmp/diff_new_pack.e7X7U4/_old 2013-10-25 11:31:17.000000000 +0200
+++ /var/tmp/diff_new_pack.e7X7U4/_new 2013-10-25 11:31:17.000000000 +0200
@@ -14,23 +14,25 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
+
Name: python-salt-testing
-Version: 0.5.1
+Version: 0.5.2
Release: 0
-License: Apache-2.0
Summary: Testing tools needed in the several Salt Stack projects
-Url: http://saltstack.org/
+License: Apache-2.0
Group: Development/Libraries/Python
+Url: http://saltstack.org/
Source0:
https://pypi.python.org/packages/source/S/SaltTesting/SaltTesting-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-devel
-BuildRequires: python-distribute
-BuildRequires: python-unittest2
BuildRequires: python-mock
-Requires: python-unittest2
+BuildRequires: python-setuptools
+BuildRequires: python-unittest2
Requires: python-mock
+Requires: python-unittest2
Recommends: python-coverage
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -38,7 +40,6 @@
BuildArch: noarch
%endif
-
%description
Salt-Testing provides the required testing tools needed in the several Salt
Stack projects.
@@ -54,6 +55,7 @@
%files
%defattr(-,root,root)
+%doc LICENSE AUTHORS.rst
%{python_sitelib}/*
%changelog
++++++ SaltTesting-0.5.1.tar.gz -> SaltTesting-0.5.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/AUTHORS.rst
new/SaltTesting-0.5.2/AUTHORS.rst
--- old/SaltTesting-0.5.1/AUTHORS.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/SaltTesting-0.5.2/AUTHORS.rst 2013-10-24 12:57:42.000000000 +0200
@@ -0,0 +1,14 @@
+Authors
+=======
+
+Here's a list of everyone who contributed to salt-testing in alphabetical
+order.
+
+========================== ===================== ============================
+Name Nick Email
+========================== ===================== ============================
+Henrik Holmboe holmboe
+Niels Abspoel aboe76
+Pedro Algarvio s0undt3ch [email protected]
+Thomas S. Hatch thatch45 [email protected]
+========================== ===================== ============================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/LICENSE
new/SaltTesting-0.5.2/LICENSE
--- old/SaltTesting-0.5.1/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/SaltTesting-0.5.2/LICENSE 2013-10-24 12:57:42.000000000 +0200
@@ -0,0 +1,16 @@
+ Saltstack Testing Tools
+
+ Copyright 2013 Pedro Algarvio for Saltsack.com
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/MANIFEST.in
new/SaltTesting-0.5.2/MANIFEST.in
--- old/SaltTesting-0.5.1/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100
+++ new/SaltTesting-0.5.2/MANIFEST.in 2013-10-24 12:53:15.000000000 +0200
@@ -0,0 +1,4 @@
+include LICENSE
+include AUTHORS.rst
+include README.rst
+exclude setup.cfg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/PKG-INFO
new/SaltTesting-0.5.2/PKG-INFO
--- old/SaltTesting-0.5.1/PKG-INFO 2013-09-27 12:20:04.000000000 +0200
+++ new/SaltTesting-0.5.2/PKG-INFO 2013-10-24 13:02:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SaltTesting
-Version: 0.5.1
+Version: 0.5.2
Summary: Required testing tools needed in the several Salt Stack projects.
Home-page: http://saltstack.org
Author: Pedro Algarvio
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/SaltTesting.egg-info/PKG-INFO
new/SaltTesting-0.5.2/SaltTesting.egg-info/PKG-INFO
--- old/SaltTesting-0.5.1/SaltTesting.egg-info/PKG-INFO 2013-09-27
12:20:01.000000000 +0200
+++ new/SaltTesting-0.5.2/SaltTesting.egg-info/PKG-INFO 2013-10-24
13:02:44.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SaltTesting
-Version: 0.5.1
+Version: 0.5.2
Summary: Required testing tools needed in the several Salt Stack projects.
Home-page: http://saltstack.org
Author: Pedro Algarvio
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/SaltTesting.egg-info/SOURCES.txt
new/SaltTesting-0.5.2/SaltTesting.egg-info/SOURCES.txt
--- old/SaltTesting-0.5.1/SaltTesting.egg-info/SOURCES.txt 2013-09-27
12:20:01.000000000 +0200
+++ new/SaltTesting-0.5.2/SaltTesting.egg-info/SOURCES.txt 2013-10-24
13:02:44.000000000 +0200
@@ -1,5 +1,7 @@
+AUTHORS.rst
+LICENSE
+MANIFEST.in
README.rst
-setup.cfg
setup.py
SaltTesting.egg-info/PKG-INFO
SaltTesting.egg-info/SOURCES.txt
@@ -10,6 +12,7 @@
salttesting/helpers.py
salttesting/mixins.py
salttesting/mock.py
+salttesting/unit.py
salttesting/version.py
salttesting/ext/HTMLTestRunner.py
salttesting/ext/__init__.py
@@ -18,4 +21,5 @@
salttesting/parser/__init__.py
salttesting/parser/cover.py
salttesting/pylintplugins/__init__.py
-salttesting/pylintplugins/pep263.py
\ No newline at end of file
+salttesting/pylintplugins/pep263.py
+salttesting/pylintplugins/pep8.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/__init__.py
new/SaltTesting-0.5.2/salttesting/__init__.py
--- old/SaltTesting-0.5.1/salttesting/__init__.py 2013-06-24
20:25:47.000000000 +0200
+++ new/SaltTesting-0.5.2/salttesting/__init__.py 2013-10-24
12:57:42.000000000 +0200
@@ -11,32 +11,21 @@
:license: Apache 2.0, see LICENSE for more details.
'''
-import sys
+# Import python libs
+import warnings
+
+# Import salt-testing libs
+from salttesting.version import __version__, __version_info__
+from salttesting.unit import (
+ TestLoader,
+ TextTestRunner,
+ TestCase,
+ expectedFailure,
+ TestSuite,
+ skipIf,
+ TestResult,
+)
-# support python < 2.7 via unittest2
-if sys.version_info < (2, 7):
- try:
- from unittest2 import (
- TestLoader,
- TextTestRunner,
- TestCase,
- expectedFailure,
- TestSuite,
- skipIf,
- TestResult,
- )
- except ImportError:
- raise SystemExit('You need to install unittest2 to run the salt tests')
-else:
- from unittest import (
- TestLoader,
- TextTestRunner,
- TestCase,
- expectedFailure,
- TestSuite,
- skipIf,
- TestResult,
- )
__all__ = [
'TestLoader',
@@ -45,5 +34,14 @@
'expectedFailure',
'TestSuite',
'skipIf',
- 'TestResult'
+ 'TestResult',
]
+
+
+# All salt-testing related deprecation warnings should be shown once each!
+warnings.filterwarnings(
+ 'once', # Show once
+ '', # No deprecation message match
+ DeprecationWarning, # This filter is for
DeprecationWarnings
+ r'^(salttesting|salttesting\.(.*))$' # Match module(s) 'salttesting' and
'salttesting.<whatever>'
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/case.py
new/SaltTesting-0.5.2/salttesting/case.py
--- old/SaltTesting-0.5.1/salttesting/case.py 2013-09-14 15:23:39.000000000
+0200
+++ new/SaltTesting-0.5.2/salttesting/case.py 2013-10-24 12:57:42.000000000
+0200
@@ -18,7 +18,7 @@
from datetime import datetime, timedelta
# Import salt testing libs
-from salttesting import TestCase
+from salttesting.unit import TestCase
class ShellTestCase(TestCase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/helpers.py
new/SaltTesting-0.5.2/salttesting/helpers.py
--- old/SaltTesting-0.5.1/salttesting/helpers.py 2013-09-19
17:30:38.000000000 +0200
+++ new/SaltTesting-0.5.2/salttesting/helpers.py 2013-10-24
12:57:42.000000000 +0200
@@ -87,11 +87,11 @@
if self.__redirected:
try:
self.__stdout.flush()
- except:
+ except Exception:
pass
try:
self.__stderr.flush()
- except:
+ except Exception:
pass
@@ -516,7 +516,6 @@
're-creating it was not possible'.format(username)
)
-
failure = None
try:
try:
@@ -566,3 +565,60 @@
)
return func(cls, grains=cls.run_function('grains.items'))
return decorator
+
+
+def requires_salt_modules(*names):
+ '''
+ Makes sure the passed salt module is available. Skips the test if not
+
+ .. versionadded:: 0.5.2
+ '''
+ def decorator(caller):
+
+ if inspect.isclass(caller):
+
+ # We're decorating a class
+ old_init = caller.__init__
+
+ def new_init(self, *args, **kwargs):
+ old_init(self, *args, **kwargs)
+
+ if not hasattr(self, 'run_function'):
+ raise RuntimeError(
+ '{0} does not have the \'run_function\' method which '
+ 'is necessary to collect the loaded modules'.format(
+ self.__class__.__name__
+ )
+ )
+
+ for name in names:
+ if name not in self.run_function('sys.doc'):
+ reason = '{0!r} is not available'.format(name)
+ for fname in dir(self):
+ if not fname.startswith('test_'):
+ continue
+ setattr(self, fname, lambda: self.skipTest(reason))
+ break
+ caller.__init__ = new_init
+ return caller
+
+ # We're simply decorating functions
+ @wraps(caller)
+ def wrapper(cls):
+
+ if not hasattr(cls, 'run_function'):
+ raise RuntimeError(
+ '{0} does not have the \'run_function\' method which is '
+ 'necessary to collect the loaded modules'.format(
+ cls.__class__.__name__
+ )
+ )
+
+ for name in names:
+ if name not in cls.run_function('sys.doc'):
+ cls.skipTest('{0!r} is not available'.format(name))
+ break
+
+ return caller(cls)
+ return wrapper
+ return decorator
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/parser/__init__.py
new/SaltTesting-0.5.2/salttesting/parser/__init__.py
--- old/SaltTesting-0.5.1/salttesting/parser/__init__.py 2013-09-09
14:35:29.000000000 +0200
+++ new/SaltTesting-0.5.2/salttesting/parser/__init__.py 2013-10-24
12:57:42.000000000 +0200
@@ -23,7 +23,7 @@
from salttesting.ext import console
width, height = console.getTerminalSize()
PNUM = width
-except:
+except Exception:
PNUM = 70
try:
@@ -284,6 +284,7 @@
)
)
logging.root.addHandler(consolehandler)
+ logging.getLogger(__name__).info('Runtests logging has been setup')
def pre_execution_cleanup(self):
'''
@@ -441,6 +442,11 @@
if self.options.no_report is False:
self.print_overall_testsuite_report()
self.post_execution_cleanup()
+ logging.getLogger(__name__).info(
+ 'Test suite execution finalized with exit code: {0}'.format(
+ exit_code
+ )
+ )
self.exit(exit_code)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SaltTesting-0.5.1/salttesting/pylintplugins/pep263.py
new/SaltTesting-0.5.2/salttesting/pylintplugins/pep263.py
--- old/SaltTesting-0.5.1/salttesting/pylintplugins/pep263.py 2013-09-19
00:41:05.000000000 +0200
+++ new/SaltTesting-0.5.2/salttesting/pylintplugins/pep263.py 2013-10-24
12:57:42.000000000 +0200
@@ -1,4 +1,15 @@
# -*- coding: utf-8 -*-
+'''
+ :codeauthor: :email:`Henrik Holmboe ([email protected])`
+ :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
+ :license: Apache 2.0, see LICENSE for more details.
+
+
+ salttesting.pylintplugins.pep263
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ PEP-263 PyLint Checker
+'''
import re
import itertools
@@ -28,6 +39,9 @@
'W9904': ('PEP263: Use UTF-8 file encoding',
'wrongly-encoded-file',
('Change file encoding and PEP263 header in file.')),
+ 'W9905': ('PEP263: Use UTF-8 file encoding',
+ 'no-encoding-in-empty-file',
+ ('There is no PEP263 compliant file encoding in file.')),
}
priority = -1
options = ()
@@ -45,6 +59,8 @@
twolines = list(itertools.islice(node.file_stream, 2))
pep263_encoding = [m.group(1).lower() for l in twolines for m in
[pep263.search(l)] if m]
+ multiple_encodings = len(pep263_encoding) > 1
+ file_empty = len(twolines) == 0
# - If the file has an UTF-8 BOM and yet uses any other
# encoding, it will be caught by F0002
@@ -54,14 +70,17 @@
# BOM, it will be caught by W0512
# - If there are ambiguous PEP263 encodings it will be caught
# by E0001, we still test for this
- if len(pep263_encoding) > 1:
+ if multiple_encodings:
self.add_message('W9901', line=1)
if node.file_encoding:
pylint_encoding = node.file_encoding.lower()
if pep263_encoding and pylint_encoding not in pep263_encoding:
self.add_message('W9902', line=1)
if not pep263_encoding:
- self.add_message('W9903', line=1)
+ if file_empty:
+ self.add_message('W9905', line=1)
+ else:
+ self.add_message('W9903', line=1)
elif self.REQ_ENCOD not in pep263_encoding:
self.add_message('W9904', line=1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/pylintplugins/pep8.py
new/SaltTesting-0.5.2/salttesting/pylintplugins/pep8.py
--- old/SaltTesting-0.5.1/salttesting/pylintplugins/pep8.py 1970-01-01
01:00:00.000000000 +0100
+++ new/SaltTesting-0.5.2/salttesting/pylintplugins/pep8.py 2013-10-24
12:57:42.000000000 +0200
@@ -0,0 +1,316 @@
+# -*- coding: utf-8 -*-
+'''
+ :codeauthor: :email:`Pedro Algarvio ([email protected])`
+ :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
+ :license: Apache 2.0, see LICENSE for more details.
+
+
+ salttesting.pylintplugins.pep8
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ PEP-8 PyLint Checker
+'''
+
+# Let's use absolute imports
+from __future__ import absolute_import
+
+# Import PyLint libs
+from pylint.interfaces import IRawChecker
+from pylint.checkers import BaseChecker
+
+# Import PEP8 libs
+from pep8 import StyleGuide, BaseReport
+
+_PROCESSED_NODES = {}
+
+
+class PyLintPEP8Reporter(BaseReport):
+ def __init__(self, options):
+ super(PyLintPEP8Reporter, self).__init__(options)
+ self.locations = []
+
+ def error(self, line_number, offset, text, check):
+ code = super(PyLintPEP8Reporter, self).error(
+ line_number, offset, text, check
+ )
+ if code:
+ # E123, at least, is not reporting it's code in the above call,
+ # don't want to bother about that now
+ self.locations.append((code, line_number))
+
+
+class _PEP8BaseChecker(BaseChecker):
+
+ __implements__ = IRawChecker
+
+ name = 'pep8'
+
+ priority = -1
+ options = ()
+
+ msgs = None
+ _msgs = {}
+ msgs_map = {}
+
+ def __init__(self, linter=None):
+ # To avoid PyLints deprecation about a missing symbolic name and
+ # because I don't want to add descriptions, let's make the descriptions
+ # equal to the messages.
+ if self.msgs is None:
+ self.msgs = {}
+
+ for code, (message, symbolic) in self._msgs.iteritems():
+ self.msgs[code] = (message, symbolic, message)
+
+ BaseChecker.__init__(self, linter=linter)
+
+ def process_module(self, node):
+ '''
+ process a module
+
+ the module's content is accessible via node.file_stream object
+ '''
+ if node.path not in _PROCESSED_NODES:
+ stylechecker = StyleGuide(
+ parse_argv=False, config_file=True, quiet=2,
+ reporter=PyLintPEP8Reporter
+ )
+
+ _PROCESSED_NODES[node.path] = stylechecker.check_files([node.path])
+
+ for code, lineno in _PROCESSED_NODES[node.path].locations:
+ pylintcode = '{0}8{1}'.format(code[0], code[1:])
+ if pylintcode in self.msgs_map:
+ # This will be handled by PyLint itself, skip it
+ continue
+
+ if pylintcode not in self.msgs:
+ # Log warning??
+ continue
+
+ self.add_message(pylintcode, line=lineno, args=code)
+
+
+class PEP8Indentation(_PEP8BaseChecker):
+ '''
+ Process PEP8 E1 codes
+ '''
+
+ _msgs = {
+ 'E8101': ('PEP8 %s: indentation contains mixed spaces and tabs',
+ 'indentation-contains-mixed-spaces-and-tabs'),
+ 'E8111': ('PEP8 %s: indentation is not a multiple of four',
+ 'indentation-is-not-a-multiple-of-four'),
+ 'E8112': ('PEP8 %s: expected an indented block',
+ 'expected-an-indented-block'),
+ 'E8113': ('PEP8 %s: unexpected indentation',
+ 'unexpected-indentation'),
+ 'E8121': ('PEP8 %s: continuation line indentation is not a multiple of
four',
+ 'continuation-line-indentation-is-not-a-multiple-of-four'),
+ 'E8122': ('PEP8 %s: continuation line missing indentation or
outdented',
+ 'continuation-line-missing-indentation-or-outdented'),
+ 'E8123': ("PEP8 %s: closing bracket does not match indentation of
opening bracket's line",
+
"closing-bracket-does-not-match-indentation-of-opening-bracket's-line"),
+ 'E8124': ('PEP8 %s: closing bracket does not match visual indentation',
+ 'closing-bracket-does-not-match-visual-indentation'),
+ 'E8125': ('PEP8 %s: continuation line does not distinguish itself from
next logical line',
+
'continuation-line-does-not-distinguish-itself-from-next-logical-line'),
+ 'E8126': ('PEP8 %s: continuation line over-indented for hanging
indent',
+ 'continuation-line-over-indented-for-hanging-indent'),
+ 'E8127': ('PEP8 %s: continuation line over-indented for visual indent',
+ 'continuation-line-over-indented-for-visual-indent'),
+ 'E8128': ('PEP8 %s: continuation line under-indented for visual
indent',
+ 'continuation-line-under-indented-for-visual-indent'),
+ 'E8133': ('PEP8 %s: closing bracket is missing indentation',
+ 'closing-bracket-is-missing-indentation'),
+ }
+
+
+class PEP8Whitespace(_PEP8BaseChecker):
+ '''
+ Process PEP8 E2 codes
+ '''
+
+ _msgs = {
+ 'E8201': ("PEP8 %s: whitespace after '('", "whitespace-after-'('"),
+ 'E8202': ("PEP8 %s: whitespace before ')'", "whitespace-before-')'"),
+ 'E8203': ("PEP8 %s: whitespace before ':'", "whitespace-before-':'"),
+ 'E8211': ("PEP8 %s: whitespace before '('", "whitespace-before-'('"),
+ 'E8221': ('PEP8 %s: multiple spaces before operator',
+ 'multiple-spaces-before-operator'),
+ 'E8222': ('PEP8 %s: multiple spaces after operator',
+ 'multiple-spaces-after-operator'),
+ 'E8223': ('PEP8 %s: tab before operator', 'tab-before-operator'),
+ 'E8224': ('PEP8 %s: tab after operator', 'tab-after-operator'),
+ 'E8225': ('PEP8 %s: missing whitespace around operator',
+ 'missing-whitespace-around-operator'),
+ 'E8226': ('PEP8 %s: missing whitespace around arithmetic operator',
+ 'missing-whitespace-around-arithmetic-operator'),
+ 'E8227': ('PEP8 %s: missing whitespace around bitwise or shift
operator',
+ 'missing-whitespace-around-bitwise-or-shift-operator'),
+ 'E8228': ('PEP8 %s: missing whitespace around modulo operator',
+ 'missing-whitespace-around-modulo-operator'),
+ 'E8231': ("PEP8 %s: missing whitespace after ','",
+ "missing-whitespace-after-','"),
+ 'E8241': ("PEP8 %s: multiple spaces after ','",
"multiple-spaces-after-','"),
+ 'E8242': ("PEP8 %s: tab after ','", "tab-after-','"),
+ 'E8251': ('PEP8 %s: unexpected spaces around keyword / parameter
equals',
+ 'unexpected-spaces-around-keyword-/-parameter-equals'),
+ 'E8261': ('PEP8 %s: at least two spaces before inline comment',
+ 'at-least-two-spaces-before-inline-comment'),
+ 'E8262': ("PEP8 %s: inline comment should start with '# '",
+ "inline-comment-should-start-with-'#-'"),
+ 'E8271': ('PEP8 %s: multiple spaces after keyword',
+ 'multiple-spaces-after-keyword'),
+ 'E8272': ('PEP8 %s: multiple spaces before keyword',
+ 'multiple-spaces-before-keyword'),
+ 'E8273': ('PEP8 %s: tab after keyword', 'tab-after-keyword'),
+ 'E8274': ('PEP8 %s: tab before keyword', 'tab-before-keyword'),
+ }
+
+
+class PEP8BlankLine(_PEP8BaseChecker):
+ '''
+ Process PEP8 E3 codes
+ '''
+
+ _msgs = {
+ 'E8301': ('PEP8 %s: expected 1 blank line, found 0',
+ 'expected-1-blank-line,-found-0'),
+ 'E8302': ('PEP8 %s: expected 2 blank lines, found 0',
+ 'expected-2-blank-lines,-found-0'),
+ 'E8303': ('PEP8 %s: too many blank lines (3)',
+ 'too-many-blank-lines-(3)'),
+ 'E8304': ('PEP8 %s: blank lines found after function decorator',
+ 'blank-lines-found-after-function-decorator'),
+ }
+
+
+class PEP8Import(_PEP8BaseChecker):
+ '''
+ Process PEP8 E4 codes
+ '''
+
+ _msgs = {
+ 'E8401': ('PEP8 %s: multiple imports on one line',
+ 'multiple-imports-on-one-line'),
+ }
+
+
+class PEP8LineLength(_PEP8BaseChecker):
+ '''
+ Process PEP8 E5 codes
+ '''
+
+ _msgs = {
+ 'E8501': ('PEP8 %s: line too long (82 > 79 characters)',
+ 'line-too-long-(82->-79-characters)'),
+ 'E8502': ('PEP8 %s: the backslash is redundant between brackets',
+ 'the-backslash-is-redundant-between-brackets')
+ }
+
+ msgs_map = {
+ 'E8501': 'C0301'
+ }
+
+
+class PEP8Statement(_PEP8BaseChecker):
+ '''
+ Process PEP8 E7 codes
+ '''
+
+ _msgs = {
+ 'E8701': ('PEP8 %s: multiple statements on one line (colon)',
+ 'multiple-statements-on-one-line-(colon)'),
+ 'E8702': ('PEP8 %s: multiple statements on one line (semicolon)',
+ 'multiple-statements-on-one-line-(semicolon)'),
+ 'E8703': ('PEP8 %s: statement ends with a semicolon',
+ 'statement-ends-with-a-semicolon'),
+ 'E8711': ("PEP8 %s: comparison to None should be 'if cond is None:'",
+ "comparison-to-None-should-be-'if-cond-is-None:'"),
+ 'E8712': ("PEP8 %s: comparison to True should be 'if cond is True:' or
'if cond:'",
+
"comparison-to-True-should-be-'if-cond-is-True:'-or-'if-cond:'"),
+ 'E8721': ("PEP8 %s: do not compare types, use 'isinstance()'",
+ "do-not-compare-types,-use-'isinstance()'"),
+ }
+
+
+class PEP8Runtime(_PEP8BaseChecker):
+ '''
+ Process PEP8 E9 codes
+ '''
+
+ _msgs = {
+ 'E8901': ('PEP8 %s: SyntaxError or IndentationError',
+ 'SyntaxError-or-IndentationError'),
+ 'E8902': ('PEP8 %s: IOError', 'IOError'),
+ }
+
+
+class PEP8IndentationWarning(_PEP8BaseChecker):
+ '''
+ Process PEP8 W1 codes
+ '''
+
+ _msgs = {
+ 'W8191': ('PEP8 %s: indentation contains tabs',
+ 'indentation-contains-tabs'),
+ }
+
+
+class PEP8WhitespaceWarning(_PEP8BaseChecker):
+ '''
+ Process PEP8 W2 codes
+ '''
+
+ _msgs = {
+ 'W8291': ('PEP8 %s: trailing whitespace', 'trailing-whitespace'),
+ 'W8292': ('PEP8 %s: no newline at end of file',
'no-newline-at-end-of-file'),
+ 'W8293': ('PEP8 %s: blank line contains whitespace',
+ 'blank-line-contains-whitespace'),
+ }
+
+
+class PEP8BlankLineWarning(_PEP8BaseChecker):
+ '''
+ Process PEP8 W3 codes
+ '''
+
+ _msgs = {
+ 'W8391': ('PEP8 %s: blank line at end of file',
+ 'blank-line-at-end-of-file'),
+ }
+
+
+class PEP8DeprecationWarning(_PEP8BaseChecker):
+ '''
+ Process PEP8 W6 codes
+ '''
+
+ _msgs = {
+ 'W8601': ("PEP8 %s: .has_key() is deprecated, use 'in'",
+ ".has_key()-is-deprecated,-use-'in'"),
+ 'W8602': ('PEP8 %s: deprecated form of raising exception',
+ 'deprecated-form-of-raising-exception'),
+ 'W8603': ("PEP8 %s: '<>' is deprecated, use '!='",
+ "'<>'-is-deprecated,-use-'!='"),
+ 'W8604': ("PEP8 %s: backticks are deprecated, use 'repr()'",
+ "backticks-are-deprecated,-use-'repr()'")
+ }
+
+
+def register(linter):
+ '''
+ required method to auto register this checker
+ '''
+ linter.register_checker(PEP8Indentation(linter))
+ linter.register_checker(PEP8Whitespace(linter))
+ linter.register_checker(PEP8BlankLine(linter))
+ linter.register_checker(PEP8Import(linter))
+ linter.register_checker(PEP8LineLength(linter))
+ linter.register_checker(PEP8Statement(linter))
+ linter.register_checker(PEP8Runtime(linter))
+ linter.register_checker(PEP8IndentationWarning(linter))
+ linter.register_checker(PEP8WhitespaceWarning(linter))
+ linter.register_checker(PEP8BlankLineWarning(linter))
+ linter.register_checker(PEP8DeprecationWarning(linter))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/unit.py
new/SaltTesting-0.5.2/salttesting/unit.py
--- old/SaltTesting-0.5.1/salttesting/unit.py 1970-01-01 01:00:00.000000000
+0100
+++ new/SaltTesting-0.5.2/salttesting/unit.py 2013-10-24 12:57:42.000000000
+0200
@@ -0,0 +1,116 @@
+# -*- coding: utf-8 -*-
+'''
+ :codeauthor: :email:`Pedro Algarvio ([email protected])`
+ :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
+ :license: Apache 2.0, see LICENSE for more details.
+
+
+ salttesting.unit
+ ~~~~~~~~~~~~~~~~
+
+ Unit test related functions
+'''
+
+import sys
+
+# support python < 2.7 via unittest2
+if sys.version_info < (2, 7):
+ try:
+ from unittest2 import (
+ TestLoader,
+ TextTestRunner,
+ TestCase as _TestCase,
+ expectedFailure,
+ TestSuite,
+ skipIf,
+ TestResult,
+ )
+ except ImportError:
+ raise SystemExit('You need to install unittest2 to run the salt tests')
+else:
+ from unittest import (
+ TestLoader,
+ TextTestRunner,
+ TestCase as _TestCase,
+ expectedFailure,
+ TestSuite,
+ skipIf,
+ TestResult,
+ )
+
+
+class TestCase(_TestCase):
+
+ def assertEquals(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('assertEquals', 'assertEqual')
+ )
+ return _TestCase.assertEquals(self, *args, **kwargs)
+
+ def failUnlessEqual(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failUnlessEqual', 'assertEqual')
+ )
+ return _TestCase.failUnlessEqual(self, *args, **kwargs)
+
+ def failIfEqual(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failIfEqual', 'assertNotEqual')
+ )
+ return _TestCase.failIfEqual(self, *args, **kwargs)
+
+ def failUnless(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failUnless', 'assertTrue')
+ )
+ return _TestCase.failUnless(self, *args, **kwargs)
+
+ def assert_(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('assert_', 'assertTrue')
+ )
+ return _TestCase.assert_(self, *args, **kwargs)
+
+ def failIf(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failIf', 'assertFalse')
+ )
+ return _TestCase.failIf(self, *args, **kwargs)
+
+ def failUnlessRaises(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failUnlessRaises', 'assertRaises')
+ )
+ return _TestCase.failUnlessRaises(self, *args, **kwargs)
+
+ def failUnlessAlmostEqual(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failUnlessAlmostEqual', 'assertAlmostEqual')
+ )
+ return _TestCase.failUnlessAlmostEqual(self, *args, **kwargs)
+
+ def failIfAlmostEqual(self, *args, **kwargs):
+ raise DeprecationWarning(
+ 'The {0}() function is deprecated. Please start using {1}() '
+ 'instead.'.format('failIfAlmostEqual', 'assertNotAlmostEqual')
+ )
+ return _TestCase.failIfAlmostEqual(self, *args, **kwargs)
+
+
+__all__ = [
+ 'TestLoader',
+ 'TextTestRunner',
+ 'TestCase',
+ 'expectedFailure',
+ 'TestSuite',
+ 'skipIf',
+ 'TestResult'
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/salttesting/version.py
new/SaltTesting-0.5.2/salttesting/version.py
--- old/SaltTesting-0.5.1/salttesting/version.py 2013-08-15
14:43:25.000000000 +0200
+++ new/SaltTesting-0.5.2/salttesting/version.py 2013-10-24
12:57:42.000000000 +0200
@@ -8,5 +8,5 @@
:license: Apache 2.0, see LICENSE for more details.
'''
-__version_info__ = (0, 5, 1)
+__version_info__ = (0, 5, 2)
__version__ = '.'.join(map(str, __version_info__))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/setup.cfg
new/SaltTesting-0.5.2/setup.cfg
--- old/SaltTesting-0.5.1/setup.cfg 2013-09-27 12:20:04.000000000 +0200
+++ new/SaltTesting-0.5.2/setup.cfg 2013-10-24 13:02:48.000000000 +0200
@@ -1,10 +1,3 @@
-[upload]
-sign = true
-identity = 84A298FF
-
-[aliases]
-release = clean register sdist upload
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SaltTesting-0.5.1/setup.py
new/SaltTesting-0.5.2/setup.py
--- old/SaltTesting-0.5.1/setup.py 2013-09-19 00:53:23.000000000 +0200
+++ new/SaltTesting-0.5.2/setup.py 2013-10-24 12:57:16.000000000 +0200
@@ -7,7 +7,7 @@
import sys
from distutils.core import setup
-setup_kwargs = {}
+SETUP_KWARGS = {}
USE_SETUPTOOLS = False
if 'USE_SETUPTOOLS' in os.environ:
@@ -16,8 +16,8 @@
USE_SETUPTOOLS = True
if sys.version_info < (2, 7):
- setup_kwargs['install_requires'] = ['unittest2']
- except:
+ SETUP_KWARGS['install_requires'] = ['unittest2']
+ except ImportError:
USE_SETUPTOOLS = False
@@ -60,7 +60,7 @@
'salttesting',
'salttesting/ext',
'salttesting/parser',
- 'salttesting/pylintplugins'
+ 'salttesting/pylintplugins',
],
- **setup_kwargs
+ **SETUP_KWARGS
)
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]