commit python3-pyflakes for openSUSE:Factory
Hello community, here is the log from the commit of package python3-pyflakes for openSUSE:Factory checked in at 2016-09-05 21:23:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-pyflakes (Old) and /work/SRC/openSUSE:Factory/.python3-pyflakes.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-pyflakes" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-pyflakes/python3-pyflakes.changes 2016-08-18 09:17:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-pyflakes.new/python3-pyflakes.changes 2016-09-05 21:24:14.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Sep 3 21:59:21 UTC 2016 - arun@gmx.de + +- update to version 1.3.0: + * Fix PyPy2 Windows IntegrationTests + * Check for duplicate dictionary keys + * Fix TestMain tests on Windows + * Fix "continue" and "break" checks ignoring py3.5's "async for" + loop + +------------------------------------------------------------------- Old: ---- pyflakes-1.2.3.tar.gz New: ---- pyflakes-1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-pyflakes.spec ++++++ --- /var/tmp/diff_new_pack.342QlK/_old 2016-09-05 21:24:18.000000000 +0200 +++ /var/tmp/diff_new_pack.342QlK/_new 2016-09-05 21:24:18.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-pyflakes -Version: 1.2.3 +Version: 1.3.0 Release: 0 Url: https://github.com/pyflakes/pyflakes Summary: Passive checker of Python 3 programs ++++++ pyflakes-1.2.3.tar.gz -> pyflakes-1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/NEWS.txt new/pyflakes-1.3.0/NEWS.txt --- old/pyflakes-1.2.3/NEWS.txt 2016-05-12 20:30:42.000000000 +0200 +++ new/pyflakes-1.3.0/NEWS.txt 2016-09-01 21:57:08.000000000 +0200 @@ -1,3 +1,9 @@ +1.3.0 (2016-09-01): + - Fix PyPy2 Windows IntegrationTests + - Check for duplicate dictionary keys + - Fix TestMain tests on Windows + - Fix "continue" and "break" checks ignoring py3.5's "async for" loop + 1.2.3 (2016-05-12): - Fix TypeError when processing relative imports @@ -5,7 +11,7 @@ - Avoid traceback when exception is del-ed in except 1.2.1 (2015-05-05): - - Fix false RedefinedWhileUnesed for submodule imports + - Fix false RedefinedWhileUnused for submodule imports 1.2.0 (2016-05-03): - Warn against reusing exception names after the except: block on Python 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/PKG-INFO new/pyflakes-1.3.0/PKG-INFO --- old/pyflakes-1.2.3/PKG-INFO 2016-05-12 20:38:30.000000000 +0200 +++ new/pyflakes-1.3.0/PKG-INFO 2016-09-01 22:03:41.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 1.2.3 +Version: 1.3.0 Summary: passive checker of Python programs Home-page: https://github.com/pyflakes/pyflakes Author: A lot of people @@ -80,8 +80,8 @@ All changes should be include tests and pass flake8_. - .. image:: https://api.travis-ci.org/pyflakes/pyflakes.png - :target: https://travis-ci.org/pyflakes/pyflakes + .. image:: https://api.travis-ci.org/PyCQA/pyflakes.svg + :target: https://travis-ci.org/PyCQA/pyflakes :alt: Build status .. _Pylint: http://www.pylint.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/README.rst new/pyflakes-1.3.0/README.rst --- old/pyflakes-1.2.3/README.rst 2016-05-06 00:37:30.000000000 +0200 +++ new/pyflakes-1.3.0/README.rst 2016-09-01 21:49:06.000000000 +0200 @@ -72,8 +72,8 @@ All changes should be include tests and pass flake8_. -.. image:: https://api.travis-ci.org/pyflakes/pyflakes.png - :target: https://travis-ci.org/pyflakes/pyflakes +.. image:: https://api.travis-ci.org/PyCQA/pyflakes.svg + :target: https://travis-ci.org/PyCQA/pyflakes :alt: Build status .. _Pylint: http://www.pylint.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/__init__.py new/pyflakes-1.3.0/pyflakes/__init__.py --- old/pyflakes-1.2.3/pyflakes/__init__.py 2016-05-12 20:29:17.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes/__init__.py 2016-09-01 21:57:14.000000000 +0200 @@ -1 +1 @@ -__version__ = '1.2.3' +__version__ = '1.3.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/checker.py new/pyflakes-1.3.0/pyflakes/checker.py --- old/pyflakes-1.2.3/pyflakes/checker.py 2016-05-12 20:29:04.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes/checker.py 2016-09-01 21:49:06.000000000 +0200 @@ -12,6 +12,7 @@ PY2 = sys.version_info < (3, 0) PY32 = sys.version_info < (3, 3) # Python 2.5 to 3.2 PY33 = sys.version_info < (3, 4) # Python 2.5 to 3.3 +PY34 = sys.version_info < (3, 5) # Python 2.5 to 3.4 try: sys.pypy_version_info PYPY = True @@ -55,6 +56,11 @@ if isinstance(n, ast.Try): return [n.body + n.orelse] + [[hdl] for hdl in n.handlers] +if PY34: + LOOP_TYPES = (ast.While, ast.For) +else: + LOOP_TYPES = (ast.While, ast.For, ast.AsyncFor) + class _FieldsOrder(dict): """Fix order of AST node fields.""" @@ -75,6 +81,17 @@ return fields +def counter(items): + """ + Simplest required implementation of collections.Counter. Required as 2.6 + does not have Counter in collections. + """ + results = {} + for item in items: + results[item] = results.get(item, 0) + 1 + return results + + def iter_child_nodes(node, omit=None, _fields_order=_FieldsOrder()): """ Yield all direct child nodes of *node*, that is, all fields that @@ -91,6 +108,33 @@ yield item +def convert_to_value(item): + if isinstance(item, ast.Str): + return item.s + elif hasattr(ast, 'Bytes') and isinstance(item, ast.Bytes): + return item.s + elif isinstance(item, ast.Tuple): + return tuple(convert_to_value(i) for i in item.elts) + elif isinstance(item, ast.Num): + return item.n + elif isinstance(item, ast.Name): + result = VariableKey(item=item) + constants_lookup = { + 'True': True, + 'False': False, + 'None': None, + } + return constants_lookup.get( + result.name, + result, + ) + elif (not PY33) and isinstance(item, ast.NameConstant): + # None, True, False are nameconstants in python3, but names in 2 + return item.value + else: + return UnhandledKeyType() + + class Binding(object): """ Represents the binding of a value to a name. @@ -127,6 +171,31 @@ """ +class UnhandledKeyType(object): + """ + A dictionary key of a type that we cannot or do not check for duplicates. + """ + + +class VariableKey(object): + """ + A dictionary key which is a variable. + + @ivar item: The variable AST object. + """ + def __init__(self, item): + self.name = item.id + + def __eq__(self, compare): + return ( + compare.__class__ == self.__class__ + and compare.name == self.name + ) + + def __hash__(self): + return hash(self.name) + + class Importation(Definition): """ A binding created by an import statement. @@ -235,7 +304,7 @@ class StarImportation(Importation): - """A binding created by an 'from x import *' statement.""" + """A binding created by a 'from x import *' statement.""" def __init__(self, name, source): super(StarImportation, self).__init__('*', source) @@ -730,7 +799,7 @@ return if on_conditional_branch(): - # We can not predict if this conditional branch is going to + # We cannot predict if this conditional branch is going to # be executed. return @@ -849,7 +918,7 @@ PASS = ignore # "expr" type nodes - BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = \ + BOOLOP = BINOP = UNARYOP = IFEXP = SET = \ COMPARE = CALL = REPR = ATTRIBUTE = SUBSCRIPT = \ STARRED = NAMECONSTANT = handleChildren @@ -870,6 +939,42 @@ # additional node types COMPREHENSION = KEYWORD = FORMATTEDVALUE = handleChildren + def DICT(self, node): + # Complain if there are duplicate keys with different values + # If they have the same value it's not going to cause potentially + # unexpected behaviour so we'll not complain. + keys = [ + convert_to_value(key) for key in node.keys + ] + + key_counts = counter(keys) + duplicate_keys = [ + key for key, count in key_counts.items() + if count > 1 + ] + + for key in duplicate_keys: + key_indices = [i for i, i_key in enumerate(keys) if i_key == key] + + values = counter( + convert_to_value(node.values[index]) + for index in key_indices + ) + if any(count == 1 for value, count in values.items()): + for key_index in key_indices: + key_node = node.keys[key_index] + if isinstance(key, VariableKey): + self.report(messages.MultiValueRepeatedKeyVariable, + key_node, + key.name) + else: + self.report( + messages.MultiValueRepeatedKeyLiteral, + key_node, + key, + ) + self.handleChildren(node) + def ASSERT(self, node): if isinstance(node.test, ast.Tuple) and node.test.elts != []: self.report(messages.AssertTuple, node) @@ -943,7 +1048,7 @@ n = node while hasattr(n, 'parent'): n, n_child = n.parent, n - if isinstance(n, (ast.While, ast.For)): + if isinstance(n, LOOP_TYPES): # Doesn't apply unless it's in the loop itself if n_child not in n.orelse: return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/messages.py new/pyflakes-1.3.0/pyflakes/messages.py --- old/pyflakes-1.2.3/pyflakes/messages.py 2016-03-01 15:04:37.000000000 +0100 +++ new/pyflakes-1.3.0/pyflakes/messages.py 2016-09-01 21:49:06.000000000 +0200 @@ -116,6 +116,22 @@ self.message_args = (name,) +class MultiValueRepeatedKeyLiteral(Message): + message = 'dictionary key %r repeated with different values' + + def __init__(self, filename, loc, key): + Message.__init__(self, filename, loc) + self.message_args = (key,) + + +class MultiValueRepeatedKeyVariable(Message): + message = 'dictionary key variable %s repeated with different values' + + def __init__(self, filename, loc, key): + Message.__init__(self, filename, loc) + self.message_args = (key,) + + class LateFutureImport(Message): message = 'from __future__ imports must occur at the beginning of the file' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/test/test_api.py new/pyflakes-1.3.0/pyflakes/test/test_api.py --- old/pyflakes-1.2.3/pyflakes/test/test_api.py 2016-03-15 18:28:26.000000000 +0100 +++ new/pyflakes-1.3.0/pyflakes/test/test_api.py 2016-09-01 21:49:06.000000000 +0200 @@ -8,6 +8,7 @@ import subprocess import tempfile +from pyflakes.checker import PY2 from pyflakes.messages import UnusedImport from pyflakes.reporter import Reporter from pyflakes.api import ( @@ -30,6 +31,12 @@ except AttributeError: PYPY = False +try: + WindowsError + WIN = True +except NameError: + WIN = False + ERROR_HAS_COL_NUM = ERROR_HAS_LAST_LINE = sys.version_info >= (3, 2) or PYPY @@ -55,10 +62,30 @@ class SysStreamCapturing(object): - """Replaces sys.stdin, sys.stdout and sys.stderr with StringIO objects.""" + """ + Context manager capturing sys.stdin, sys.stdout and sys.stderr. + + The file handles are replaced with a StringIO object. + On environments that support it, the StringIO object uses newlines + set to os.linesep. Otherwise newlines are converted from \\n to + os.linesep during __exit__. + """ + + def _create_StringIO(self, buffer=None): + # Python 3 has a newline argument + try: + return StringIO(buffer, newline=os.linesep) + except TypeError: + self._newline = True + # Python 2 creates an input only stream when buffer is not None + if buffer is None: + return StringIO() + else: + return StringIO(buffer) def __init__(self, stdin): - self._stdin = StringIO(stdin or '') + self._newline = False + self._stdin = self._create_StringIO(stdin or '') def __enter__(self): self._orig_stdin = sys.stdin @@ -66,8 +93,8 @@ self._orig_stderr = sys.stderr sys.stdin = self._stdin - sys.stdout = self._stdout_stringio = StringIO() - sys.stderr = self._stderr_stringio = StringIO() + sys.stdout = self._stdout_stringio = self._create_StringIO() + sys.stderr = self._stderr_stringio = self._create_StringIO() return self @@ -75,6 +102,10 @@ self.output = self._stdout_stringio.getvalue() self.error = self._stderr_stringio.getvalue() + if self._newline and os.linesep != '\n': + self.output = self.output.replace('\n', os.linesep) + self.error = self.error.replace('\n', os.linesep) + sys.stdin = self._orig_stdin sys.stdout = self._orig_stdout sys.stderr = self._orig_stderr @@ -637,6 +668,9 @@ if sys.version_info >= (3,): stdout = stdout.decode('utf-8') stderr = stderr.decode('utf-8') + # Workaround https://bitbucket.org/pypy/pypy/issues/2350 + if PYPY and PY2 and WIN: + stderr = stderr.replace('\r\r\n', '\r\n') return (stdout, stderr, rv) def test_goodFile(self): @@ -661,7 +695,7 @@ expected = UnusedImport(self.tempfilepath, Node(1), 'contraband') self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1)) - def test_errors(self): + def test_errors_io(self): """ When pyflakes finds errors with the files it's given, (if they don't exist, say), then the return code is non-zero and the errors are @@ -672,6 +706,20 @@ os.linesep) self.assertEqual(d, ('', error_msg, 1)) + def test_errors_syntax(self): + """ + When pyflakes finds errors with the files it's given, (if they don't + exist, say), then the return code is non-zero and the errors are + printed to stderr. + """ + fd = open(self.tempfilepath, 'wb') + fd.write("import".encode('ascii')) + fd.close() + d = self.runPyflakes([self.tempfilepath]) + error_msg = '{0}:1:{2}: invalid syntax{1}import{1} {3}^{1}'.format( + self.tempfilepath, os.linesep, 5 if PYPY else 7, '' if PYPY else ' ') + self.assertEqual(d, ('', error_msg, True)) + def test_readFromStdin(self): """ If no arguments are passed to C{pyflakes} then it reads from stdin. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/test/test_dict.py new/pyflakes-1.3.0/pyflakes/test/test_dict.py --- old/pyflakes-1.2.3/pyflakes/test/test_dict.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyflakes-1.3.0/pyflakes/test/test_dict.py 2016-09-01 21:49:06.000000000 +0200 @@ -0,0 +1,217 @@ +""" +Tests for dict duplicate keys Pyflakes behavior. +""" + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skipIf + + +class Test(TestCase): + + def test_duplicate_keys(self): + self.flakes( + "{'yes': 1, 'yes': 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info < (3,), + "bytes and strings with same 'value' are not equal in python3") + @skipIf(version_info[0:2] == (3, 2), + "python3.2 does not allow u"" literal string definition") + def test_duplicate_keys_bytes_vs_unicode_py3(self): + self.flakes("{b'a': 1, u'a': 2}") + + @skipIf(version_info < (3,), + "bytes and strings with same 'value' are not equal in python3") + @skipIf(version_info[0:2] == (3, 2), + "python3.2 does not allow u"" literal string definition") + def test_duplicate_values_bytes_vs_unicode_py3(self): + self.flakes( + "{1: b'a', 1: u'a'}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info >= (3,), + "bytes and strings with same 'value' are equal in python2") + def test_duplicate_keys_bytes_vs_unicode_py2(self): + self.flakes( + "{b'a': 1, u'a': 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info >= (3,), + "bytes and strings with same 'value' are equal in python2") + def test_duplicate_values_bytes_vs_unicode_py2(self): + self.flakes("{1: b'a', 1: u'a'}") + + def test_multiple_duplicate_keys(self): + self.flakes( + "{'yes': 1, 'yes': 2, 'no': 2, 'no': 3}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_in_function(self): + self.flakes( + ''' + def f(thing): + pass + f({'yes': 1, 'yes': 2}) + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_in_lambda(self): + self.flakes( + "lambda x: {(0,1): 1, (0,1): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_tuples(self): + self.flakes( + "{(0,1): 1, (0,1): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_tuples_int_and_float(self): + self.flakes( + "{(0,1): 1, (0,1.0): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_ints(self): + self.flakes( + "{1: 1, 1: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_bools(self): + self.flakes( + "{True: 1, True: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_bools_false(self): + # Needed to ensure 2.x correctly coerces these from variables + self.flakes( + "{False: 1, False: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_none(self): + self.flakes( + "{None: 1, None: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_variable_keys(self): + self.flakes( + ''' + a = 1 + {a: 1, a: 2} + ''', + m.MultiValueRepeatedKeyVariable, + m.MultiValueRepeatedKeyVariable, + ) + + def test_duplicate_variable_values(self): + self.flakes( + ''' + a = 1 + b = 2 + {1: a, 1: b} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_variable_values_same_value(self): + # Current behaviour is not to look up variable values. This is to + # confirm that. + self.flakes( + ''' + a = 1 + b = 1 + {1: a, 1: b} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_key_float_and_int(self): + """ + These do look like different values, but when it comes to their use as + keys, they compare as equal and so are actually duplicates. + The literal dict {1: 1, 1.0: 1} actually becomes {1.0: 1}. + """ + self.flakes( + ''' + {1: 1, 1.0: 2} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_no_duplicate_key_error_same_value(self): + self.flakes(''' + {'yes': 1, 'yes': 1} + ''') + + def test_no_duplicate_key_errors(self): + self.flakes(''' + {'yes': 1, 'no': 2} + ''') + + def test_no_duplicate_keys_tuples_same_first_element(self): + self.flakes("{(0,1): 1, (0,2): 1}") + + def test_no_duplicate_key_errors_func_call(self): + self.flakes(''' + def test(thing): + pass + test({True: 1, None: 2, False: 1}) + ''') + + def test_no_duplicate_key_errors_bool_or_none(self): + self.flakes("{True: 1, None: 2, False: 1}") + + def test_no_duplicate_key_errors_ints(self): + self.flakes(''' + {1: 1, 2: 1} + ''') + + def test_no_duplicate_key_errors_vars(self): + self.flakes(''' + test = 'yes' + rest = 'yes' + {test: 1, rest: 2} + ''') + + def test_no_duplicate_key_errors_tuples(self): + self.flakes(''' + {(0,1): 1, (0,2): 1} + ''') + + def test_no_duplicate_key_errors_instance_attributes(self): + self.flakes(''' + class Test(): + pass + f = Test() + f.a = 1 + {f.a: 1, f.a: 1} + ''') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/test/test_imports.py new/pyflakes-1.3.0/pyflakes/test/test_imports.py --- old/pyflakes-1.2.3/pyflakes/test/test_imports.py 2016-05-12 20:29:04.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes/test/test_imports.py 2016-09-01 21:49:06.000000000 +0200 @@ -180,7 +180,7 @@ def test_redefinedTry(self): """ - Test that importing a module twice in an try block + Test that importing a module twice in a try block does raise a warning. """ self.flakes(''' @@ -193,7 +193,7 @@ def test_redefinedTryExcept(self): """ - Test that importing a module twice in an try + Test that importing a module twice in a try and except block does not raise a warning. """ self.flakes(''' @@ -1149,7 +1149,7 @@ class Python26Tests(TestCase): """ - Tests for checking of syntax which is valid in PYthon 2.6 and newer. + Tests for checking of syntax which is valid in Python 2.6 and newer. """ @skipIf(version_info < (2, 6), "Python >= 2.6 only") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes/test/test_other.py new/pyflakes-1.3.0/pyflakes/test/test_other.py --- old/pyflakes-1.2.3/pyflakes/test/test_other.py 2016-03-15 18:28:26.000000000 +0100 +++ new/pyflakes-1.3.0/pyflakes/test/test_other.py 2016-09-01 21:49:06.000000000 +0200 @@ -1181,7 +1181,7 @@ return ''', m.UnusedVariable) - @skip("todo: Difficult because it does't apply in the context of a loop") + @skip("todo: Difficult because it doesn't apply in the context of a loop") def test_unusedReassignedVariable(self): """ Shadowing a used variable can still raise an UnusedVariable warning. @@ -1489,7 +1489,7 @@ def test_withStatementTupleNamesUndefined(self): """ - An undefined name warning is emitted if a name first defined by a the + An undefined name warning is emitted if a name first defined by the tuple-unpacking form of the C{with} statement is used before the C{with} statement. """ @@ -1720,6 +1720,63 @@ ''') @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_loopControlInAsyncFor(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + if row[0] == 'skip': + continue + output.append(row) + return output + ''') + + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + if row[0] == 'stop': + break + output.append(row) + return output + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_loopControlInAsyncForElse(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + output.append(row) + else: + continue + return output + ''', m.ContinueOutsideLoop) + + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + output.append(row) + else: + break + return output + ''', m.BreakOutsideLoop) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_continueInAsyncForFinally(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + try: + output.append(row) + finally: + continue + return output + ''', m.ContinueInFinally) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') def test_asyncWith(self): self.flakes(''' async def commit(session, data): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes.egg-info/PKG-INFO new/pyflakes-1.3.0/pyflakes.egg-info/PKG-INFO --- old/pyflakes-1.2.3/pyflakes.egg-info/PKG-INFO 2016-05-12 20:38:29.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes.egg-info/PKG-INFO 2016-09-01 22:03:41.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 1.2.3 +Version: 1.3.0 Summary: passive checker of Python programs Home-page: https://github.com/pyflakes/pyflakes Author: A lot of people @@ -80,8 +80,8 @@ All changes should be include tests and pass flake8_. - .. image:: https://api.travis-ci.org/pyflakes/pyflakes.png - :target: https://travis-ci.org/pyflakes/pyflakes + .. image:: https://api.travis-ci.org/PyCQA/pyflakes.svg + :target: https://travis-ci.org/PyCQA/pyflakes :alt: Build status .. _Pylint: http://www.pylint.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes.egg-info/SOURCES.txt new/pyflakes-1.3.0/pyflakes.egg-info/SOURCES.txt --- old/pyflakes-1.2.3/pyflakes.egg-info/SOURCES.txt 2016-05-12 20:38:30.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes.egg-info/SOURCES.txt 2016-09-01 22:03:41.000000000 +0200 @@ -16,13 +16,13 @@ pyflakes.egg-info/SOURCES.txt pyflakes.egg-info/dependency_links.txt pyflakes.egg-info/entry_points.txt -pyflakes.egg-info/pbr.json pyflakes.egg-info/top_level.txt pyflakes/scripts/__init__.py pyflakes/scripts/pyflakes.py pyflakes/test/__init__.py pyflakes/test/harness.py pyflakes/test/test_api.py +pyflakes/test/test_dict.py pyflakes/test/test_doctests.py pyflakes/test/test_imports.py pyflakes/test/test_other.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-1.2.3/pyflakes.egg-info/pbr.json new/pyflakes-1.3.0/pyflakes.egg-info/pbr.json --- old/pyflakes-1.2.3/pyflakes.egg-info/pbr.json 2015-09-20 18:00:22.000000000 +0200 +++ new/pyflakes-1.3.0/pyflakes.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -{"is_release": true, "git_version": "e1da183"} \ No newline at end of file
participants (1)
-
root@hilbert.suse.de