Repository: cassandra-dtest
Updated Branches:
  refs/heads/master c1bcc1866 -> 44fd9be91


CASSANDRA-14076 Fix dtest code style check


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/44fd9be9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/44fd9be9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/44fd9be9

Branch: refs/heads/master
Commit: 44fd9be91d38345bf666c2118693489f9a46de20
Parents: c1bcc18
Author: Jay Zhuang <[email protected]>
Authored: Mon Dec 4 11:18:47 2017 +0100
Committer: Philip Thompson <[email protected]>
Committed: Mon Dec 4 11:18:47 2017 +0100

----------------------------------------------------------------------
 .travis.yml                             |  8 ++++----
 consistency_test.py                     | 14 +++++++-------
 counter_tests.py                        |  4 ++--
 dtest.py                                |  3 ++-
 linter_check.sh                         |  6 +++---
 nodetool_test.py                        |  5 +++--
 plugins/dtestcollect.py                 |  9 ++++-----
 plugins/dtesttag.py                     |  8 +++-----
 plugins/dtestxunit.py                   | 20 +++++++++++---------
 repair_tests/deprecated_repair_test.py  | 12 ++++++------
 repair_tests/incremental_repair_test.py | 20 ++++++++++----------
 run_dtests.py                           |  2 +-
 secondary_indexes_test.py               |  6 +++---
 sslnodetonode_test.py                   |  2 +-
 system_keyspaces_test.py                |  5 +++--
 tools/data.py                           |  3 ++-
 upgrade_tests/thrift_upgrade_test.py    | 10 ++++++----
 write_failures_test.py                  |  1 -
 18 files changed, 71 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index a396b90..c62ad8e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,7 @@ language: python
 python:
   - "2.7"
 install:
-  - pip install pep8 flake8
+  - pip install pycodestyle flake8
 script:
   # we want pyflakes to check all files for unused imports only
   # we use flake8 because it allows us to ignore other warnings
@@ -10,11 +10,11 @@ script:
   - flake8 --ignore=E501,F811,F812,F822,F823,F831,F841,N8,C9 
--exclude=thrift_bindings,cassandra-thrift .
   - git remote add apache git://github.com/apache/cassandra-dtest.git
   - git fetch apache # fetch master for the next diff
-  # feed changed lines with no context around them to pep8
+  # feed changed lines with no context around them to pycodestyle
   # I know we don't enforce line length but if you introduce
   # 200-char lines you are doing something terribly wrong.
   # lint all files for everything but line length errors
-  - git diff apache/master...HEAD -U0 | pep8 --ignore=E501 --diff
+  - git diff apache/master...HEAD -U0 | pycodestyle --ignore=E501 --diff
   # lint all files except json_test.py for line length errors
-  - git diff apache/master...HEAD -U0 | pep8 --diff --exclude='json_test.py' 
--exclude='meta_tests/assertion_test.py' --max-line-length=200
+  - git diff apache/master...HEAD -U0 | pycodestyle --diff 
--exclude='json_test.py' --exclude='meta_tests/assertion_test.py' 
--max-line-length=200
 sudo: false

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/consistency_test.py
----------------------------------------------------------------------
diff --git a/consistency_test.py b/consistency_test.py
index b0c4936..2eaa2ca 100644
--- a/consistency_test.py
+++ b/consistency_test.py
@@ -544,7 +544,7 @@ class TestAccuracy(TestHelper):
                     valid_fcn(v)
                 except Queue.Empty:
                     pass
-                except:
+                except Exception:
                     exceptions_queue.put(sys.exc_info())
 
         start = 0
@@ -973,12 +973,12 @@ class TestConsistency(Tester):
         session.execute(query)
 
         stmt = SimpleStatement("INSERT INTO test.test (id) VALUES (0);",
-                               consistency_level = ConsistencyLevel.ALL)
+                               consistency_level=ConsistencyLevel.ALL)
         session.execute(stmt)
 
         # with node2 down and hints disabled, delete the partition on node1
         node2.stop(wait_other_notice=True)
-        session.execute("DELETE FROM test.test WHERE id = 0;");
+        session.execute("DELETE FROM test.test WHERE id = 0;")
         node2.start(wait_other_notice=True)
 
         # with both nodes up, do a CL.ALL query with per partition limit of 1;
@@ -1034,7 +1034,7 @@ class TestConsistency(Tester):
         # prior to CASSANDRA-13747 this would cause an assertion in short read 
protection code
         node2.start(wait_other_notice=True)
         stmt = SimpleStatement("SELECT DISTINCT token(id), id FROM test.test;",
-                               consistency_level = ConsistencyLevel.ALL)
+                               consistency_level=ConsistencyLevel.ALL)
         result = list(session.execute(stmt))
         assert_length_equal(result, 5)
 
@@ -1051,7 +1051,7 @@ class TestConsistency(Tester):
 
         cluster.populate(2)
         node1, node2 = cluster.nodelist()
-        remove_perf_disable_shared_mem(node1) # necessary for jmx
+        remove_perf_disable_shared_mem(node1)  # necessary for jmx
         cluster.start(wait_other_notice=True)
 
         session = self.patient_cql_connection(node1)
@@ -1100,7 +1100,7 @@ class TestConsistency(Tester):
         assert_all(session,
                    'SELECT id FROM test.test LIMIT 1;',
                    [[3]],
-                   cl = ConsistencyLevel.ALL)
+                   cl=ConsistencyLevel.ALL)
 
         srp = make_mbean('metrics', type='Table', 
name='ShortReadProtectionRequests', keyspace='test', scope='test')
         with JolokiaAgent(node1) as jmx:
@@ -1172,7 +1172,7 @@ class TestConsistency(Tester):
         assert_all(session,
                    'SELECT ck FROM test.test WHERE pk = 0 LIMIT 2;',
                    [[0], [4]],
-                   cl = ConsistencyLevel.ALL)
+                   cl=ConsistencyLevel.ALL)
 
     def short_read_test(self):
         """

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/counter_tests.py
----------------------------------------------------------------------
diff --git a/counter_tests.py b/counter_tests.py
index 48985a9..f2c746b 100644
--- a/counter_tests.py
+++ b/counter_tests.py
@@ -56,7 +56,7 @@ class TestCounters(Tester):
         #
 
         cluster.set_install_dir(version='2.1.17')
-        cluster.start();
+        cluster.start()
         cluster.nodetool("upgradesstables")
 
         #
@@ -380,7 +380,7 @@ class TestCounters(Tester):
 
         assert_invalid(session, "ALTER TABLE counter_bug add c counter", 
"Cannot re-add previously dropped counter column c")
 
-    @since("2.0", max_version="3.X") # Compact Storage
+    @since("2.0", max_version="3.X")  # Compact Storage
     def compact_counter_cluster_test(self):
         """
         @jira_ticket CASSANDRA-12219

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/dtest.py
----------------------------------------------------------------------
diff --git a/dtest.py b/dtest.py
index cdc043d..a942d12 100644
--- a/dtest.py
+++ b/dtest.py
@@ -583,7 +583,7 @@ class Tester(TestCase):
         for runner in self.runners:
             try:
                 runner.stop()
-            except:
+            except Exception:
                 pass
 
         failed = did_fail()
@@ -1127,5 +1127,6 @@ def run_scenarios(scenarios, handler, 
deferred_exceptions=tuple()):
     if errors:
         raise MultiError(errors, tracebacks)
 
+
 def supports_v5_protocol(cluster_version):
     return cluster_version >= LooseVersion('4.0')

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/linter_check.sh
----------------------------------------------------------------------
diff --git a/linter_check.sh b/linter_check.sh
index 79a77e4..fccb053 100755
--- a/linter_check.sh
+++ b/linter_check.sh
@@ -1,17 +1,17 @@
 #!/bin/bash
 
 # linter_check ensures your changes will pass on travis.
-# Requires pep8 and flake8: pip install pep8 flake8
+# Requires pycodestyle and flake8: pip install pycodestyle flake8
 
 flake8 --ignore=E501,F811,F812,F822,F823,F831,F841,N8,C9 
--exclude=thrift_bindings,cassandra-thrift .
 flake8_result=$?
 
 # lint all files for everything but line length errors
-git diff apache/master...HEAD -U0 | pep8 --ignore=E501 --diff
+git diff apache/master...HEAD -U0 | pycodestyle --ignore=E501 --diff
 pep8_style_check=$?
 
 # lint all files except json_test.py for line length errors
-git diff apache/master...HEAD -U0 | pep8 --diff --exclude='json_test.py' 
--exclude='meta_tests/assertion_test.py' --max-line-length=200
+git diff apache/master...HEAD -U0 | pycodestyle --diff 
--exclude='json_test.py' --exclude='meta_tests/assertion_test.py' 
--max-line-length=200
 pep8_line_length=$?
 
 echo -e "\nflake8 exited with ${flake8_result}."

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/nodetool_test.py
----------------------------------------------------------------------
diff --git a/nodetool_test.py b/nodetool_test.py
index 38e8622..93df2ac 100644
--- a/nodetool_test.py
+++ b/nodetool_test.py
@@ -6,6 +6,7 @@ from tools.assertions import assert_all, assert_invalid
 from tools.decorators import since
 from tools.jmxutils import JolokiaAgent, make_mbean, 
remove_perf_disable_shared_mem
 
+
 class TestNodetool(Tester):
 
     def test_decommission_after_drain_is_invalid(self):
@@ -75,7 +76,7 @@ class TestNodetool(Tester):
                  'truncate', 'misc']
         if cluster.version() < '4.0':
             types.append('streamingsocket')
-    
+
         # read all of the timeouts, make sure we get a sane response
         for timeout_type in types:
             out, err, _ = node.nodetool('gettimeout {}'.format(timeout_type))
@@ -171,7 +172,7 @@ class TestNodetool(Tester):
         cluster = self.cluster
         cluster.populate(1)
         node = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node) # for jmx
+        remove_perf_disable_shared_mem(node)  # for jmx
         cluster.start()
 
         session = self.patient_cql_connection(node)

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/plugins/dtestcollect.py
----------------------------------------------------------------------
diff --git a/plugins/dtestcollect.py b/plugins/dtestcollect.py
index e8a3c8a..6b2dac4 100644
--- a/plugins/dtestcollect.py
+++ b/plugins/dtestcollect.py
@@ -1,8 +1,4 @@
-from collections import namedtuple
-
-from pprint import pprint
 import os
-import inspect
 from nose.plugins.base import Plugin
 from nose.case import Test
 import logging
@@ -10,6 +6,7 @@ import unittest
 
 log = logging.getLogger(__name__)
 
+
 class DTestCollect(Plugin):
     """
     Collect and output test names only, don't run any tests.
@@ -41,6 +38,7 @@ class DTestCollect(Plugin):
         log.debug("Preparing test case %s", test)
         if not isinstance(test, Test):
             return
+
         def run(result):
             # We need to make these plugin calls because there won't be
             # a result proxy, due to using a stripped-down test suite
@@ -59,7 +57,8 @@ class DTestCollect(Plugin):
         else:
             tag = test.test._testMethodName + "-" + tag
         retval = "%s:%s.%s" % (test.test.__module__, 
test.test.__class__.__name__, tag)
-        return retval;
+        return retval
+
 
 class TestSuiteFactory:
     """

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/plugins/dtesttag.py
----------------------------------------------------------------------
diff --git a/plugins/dtesttag.py b/plugins/dtesttag.py
index 94effcb..e1ebb74 100644
--- a/plugins/dtesttag.py
+++ b/plugins/dtesttag.py
@@ -1,10 +1,8 @@
-from collections import namedtuple
-
 from nose import plugins
-from pprint import pprint
 import os
 import inspect
 
+
 class DTestTag(plugins.Plugin):
     enabled = True  # if this plugin is loaded at all, we're using it
     name = 'dtest_tag'
@@ -17,12 +15,12 @@ class DTestTag(plugins.Plugin):
 
     def nice_classname(self, obj):
         """Returns a nice name for class object or class instance.
-    
+
             >>> nice_classname(Exception()) # doctest: +ELLIPSIS
             '...Exception'
             >>> nice_classname(Exception) # doctest: +ELLIPSIS
             '...Exception'
-    
+
         """
         if inspect.isclass(obj):
             cls_name = obj.__name__

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/plugins/dtestxunit.py
----------------------------------------------------------------------
diff --git a/plugins/dtestxunit.py b/plugins/dtestxunit.py
index c4a041f..c996d53 100644
--- a/plugins/dtestxunit.py
+++ b/plugins/dtestxunit.py
@@ -40,10 +40,8 @@ Here is an abbreviated version of what an XML test report 
might look like::
 
 """
 import codecs
-import doctest
 import os
 import sys
-import traceback
 import re
 import inspect
 from StringIO import StringIO
@@ -59,21 +57,24 @@ CONTROL_CHARACTERS = 
re.compile(r"[\000-\010\013\014\016-\037]")
 
 TEST_ID = re.compile(r'^(.*?)(\(.*\))$')
 
+
 def xml_safe(value):
     """Replaces invalid XML characters with '?'."""
     return CONTROL_CHARACTERS.sub('?', value)
 
+
 def escape_cdata(cdata):
     """Escape a string for an XML CDATA section."""
     return xml_safe(cdata).replace(']]>', ']]>]]&gt;<![CDATA[')
 
+
 def id_split(idval):
     m = TEST_ID.match(idval)
     retval = []
     if m:
         name, fargs = m.groups()
         head, tail = name.rsplit(".", 1)
-        retval = [head, tail+fargs]
+        retval = [head, tail + fargs]
     else:
         retval = idval.rsplit(".", 1)
     tag = os.getenv('TEST_TAG', '')
@@ -81,6 +82,7 @@ def id_split(idval):
         retval[-1] = retval[-1] + "-" + tag
     return retval
 
+
 def nice_classname(obj):
     """Returns a nice name for class object or class instance.
 
@@ -104,6 +106,7 @@ def nice_classname(obj):
     else:
         return cls_name
 
+
 def exc_message(exc_info):
     """Return the exception's message."""
     exc = exc_info[1]
@@ -123,6 +126,7 @@ def exc_message(exc_info):
     result = force_unicode(result, 'UTF-8')
     return xml_safe(result)
 
+
 class Tee(object):
     def __init__(self, encoding, *args):
         self._encoding = encoding
@@ -215,8 +219,8 @@ class DTestXunit(Plugin):
                                              self.encoding, 'replace')
         self.stats['encoding'] = self.encoding
         self.stats['testsuite_name'] = self.xunit_testsuite_name
-        self.stats['total'] = (self.stats['errors'] + self.stats['failures']
-                               + self.stats['passes'] + self.stats['skipped'])
+        self.stats['total'] = (self.stats['errors'] + self.stats['failures'] +
+                               self.stats['passes'] + self.stats['skipped'])
         self.error_report_file.write(
             u'<?xml version="1.0" encoding="%(encoding)s"?>'
             u'<testsuite name="%(testsuite_name)s" tests="%(total)d" '
@@ -265,16 +269,14 @@ class DTestXunit(Plugin):
         if self._currentStdout:
             value = self._currentStdout.getvalue()
             if value:
-                return '<system-out><![CDATA[%s]]></system-out>' % 
escape_cdata(
-                        value)
+                return '<system-out><![CDATA[%s]]></system-out>' % 
escape_cdata(value)
         return ''
 
     def _getCapturedStderr(self):
         if self._currentStderr:
             value = self._currentStderr.getvalue()
             if value:
-                return '<system-err><![CDATA[%s]]></system-err>' % 
escape_cdata(
-                        value)
+                return '<system-err><![CDATA[%s]]></system-err>' % 
escape_cdata(value)
         return ''
 
     def addError(self, test, err, capt=None):

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/repair_tests/deprecated_repair_test.py
----------------------------------------------------------------------
diff --git a/repair_tests/deprecated_repair_test.py 
b/repair_tests/deprecated_repair_test.py
index 4b33842..e438f53 100644
--- a/repair_tests/deprecated_repair_test.py
+++ b/repair_tests/deprecated_repair_test.py
@@ -156,13 +156,13 @@ class TestDeprecatedRepairAPI(Tester):
         # wait for log to start
         node1.watch_log_for("Starting repair command")
         # get repair parameters from the log
-        l = node1.grep_log(("Starting repair command #1" + (" \([^\)]+\)" if 
cluster.version() >= LooseVersion("3.10") else "") +
-                            ", repairing keyspace ks with repair options 
\(parallelism: (?P<parallelism>\w+), primary range: (?P<pr>\w+), "
-                            "incremental: (?P<incremental>\w+), job threads: 
(?P<jobs>\d+), ColumnFamilies: (?P<cfs>.+), dataCenters: (?P<dc>.+), "
-                            "hosts: (?P<hosts>.+), # of ranges: 
(?P<ranges>\d+)(, pull repair: (?P<pullrepair>true|false))?\)"))
+        line = node1.grep_log(("Starting repair command #1" + (" \([^\)]+\)" 
if cluster.version() >= LooseVersion("3.10") else "") +
+                               ", repairing keyspace ks with repair options 
\(parallelism: (?P<parallelism>\w+), primary range: (?P<pr>\w+), "
+                               "incremental: (?P<incremental>\w+), job 
threads: (?P<jobs>\d+), ColumnFamilies: (?P<cfs>.+), dataCenters: (?P<dc>.+), "
+                               "hosts: (?P<hosts>.+), # of ranges: 
(?P<ranges>\d+)(, pull repair: (?P<pullrepair>true|false))?\)"))
 
-        assert_length_equal(l, 1)
-        line, m = l[0]
+        assert_length_equal(line, 1)
+        line, m = line[0]
 
         if supports_pull_repair:
             self.assertEqual(m.group("pullrepair"), "false", "Pull repair 
cannot be enabled through the deprecated API so the pull repair option should 
always be false.")

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/repair_tests/incremental_repair_test.py
----------------------------------------------------------------------
diff --git a/repair_tests/incremental_repair_test.py 
b/repair_tests/incremental_repair_test.py
index b99cf9e..95fb26d 100644
--- a/repair_tests/incremental_repair_test.py
+++ b/repair_tests/incremental_repair_test.py
@@ -769,9 +769,9 @@ class TestIncRepair(Tester):
 
     @since('4.0')
     def force_test(self):
-        """ 
-        forcing an incremental repair should incrementally repair any nodes 
-        that are up, but should not promote the sstables to repaired 
+        """
+        forcing an incremental repair should incrementally repair any nodes
+        that are up, but should not promote the sstables to repaired
         """
         cluster = self.cluster
         cluster.set_configuration_options(values={'hinted_handoff_enabled': 
False, 'num_tokens': 1, 'commitlog_sync_period_in_ms': 500})
@@ -801,9 +801,9 @@ class TestIncRepair(Tester):
 
     @since('4.0')
     def hosts_test(self):
-        """ 
-        running an incremental repair with hosts specified should 
incrementally repair 
-        the given nodes, but should not promote the sstables to repaired 
+        """
+        running an incremental repair with hosts specified should 
incrementally repair
+        the given nodes, but should not promote the sstables to repaired
         """
         cluster = self.cluster
         cluster.set_configuration_options(values={'hinted_handoff_enabled': 
False, 'num_tokens': 1, 'commitlog_sync_period_in_ms': 500})
@@ -827,9 +827,9 @@ class TestIncRepair(Tester):
 
     @since('4.0')
     def subrange_test(self):
-        """ 
-        running an incremental repair with hosts specified should 
incrementally repair 
-        the given nodes, but should not promote the sstables to repaired 
+        """
+        running an incremental repair with hosts specified should 
incrementally repair
+        the given nodes, but should not promote the sstables to repaired
         """
         cluster = self.cluster
         cluster.set_configuration_options(values={'hinted_handoff_enabled': 
False,
@@ -852,7 +852,7 @@ class TestIncRepair(Tester):
             self.assertNoRepairedSSTables(node, 'ks')
 
         # only repair the partition k=0
-        token = Murmur3Token.from_key(str(bytearray([0,0,0,0])))
+        token = Murmur3Token.from_key(str(bytearray([0, 0, 0, 0])))
         # import ipdb; ipdb.set_trace()
         # run with force flag
         node1.repair(options=['ks', '-st', str(token.value - 1), '-et', 
str(token.value)])

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/run_dtests.py
----------------------------------------------------------------------
diff --git a/run_dtests.py b/run_dtests.py
index 4f2d187..e7165af 100755
--- a/run_dtests.py
+++ b/run_dtests.py
@@ -217,7 +217,7 @@ if __name__ == '__main__':
             "import nose\n" +
             "from plugins.dtestconfig import DtestConfigPlugin, 
GlobalConfigObject\n" +
             "from plugins.dtestxunit import DTestXunit\n" +
-            "from plugins.dtesttag import DTestTag\n"  +
+            "from plugins.dtesttag import DTestTag\n" +
             "from plugins.dtestcollect import DTestCollect\n" +
             "import sys\n" +
             "print sys.getrecursionlimit()\n" +

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/secondary_indexes_test.py
----------------------------------------------------------------------
diff --git a/secondary_indexes_test.py b/secondary_indexes_test.py
index 183aae3..df5872a 100644
--- a/secondary_indexes_test.py
+++ b/secondary_indexes_test.py
@@ -11,13 +11,13 @@ from cassandra.concurrent import (execute_concurrent,
 from cassandra.protocol import ConfigurationException
 from cassandra.query import BatchStatement, SimpleStatement
 
-from dtest import (DISABLE_VNODES, OFFHEAP_MEMTABLES, DtestTimeoutError,
-                   Tester, debug, CASSANDRA_VERSION_FROM_BUILD, create_ks, 
create_cf)
+from dtest import (DISABLE_VNODES, OFFHEAP_MEMTABLES, Tester, debug, 
CASSANDRA_VERSION_FROM_BUILD, create_ks, create_cf)
 from tools.assertions import assert_bootstrap_state, assert_invalid, 
assert_none, assert_one, assert_row_count
-from tools.data import block_until_index_is_built, index_is_built, rows_to_list
+from tools.data import block_until_index_is_built, rows_to_list
 from tools.decorators import since
 from tools.misc import new_node
 
+
 class TestSecondaryIndexes(Tester):
 
     @staticmethod

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/sslnodetonode_test.py
----------------------------------------------------------------------
diff --git a/sslnodetonode_test.py b/sslnodetonode_test.py
index a82f411..4c4a188 100644
--- a/sslnodetonode_test.py
+++ b/sslnodetonode_test.py
@@ -12,6 +12,7 @@ from tools.decorators import since
 _LOG_ERR_HANDSHAKE = "javax.net.ssl.SSLHandshakeException"
 _LOG_ERR_GENERAL = "javax.net.ssl.SSLException"
 
+
 @since('3.6')
 class TestNodeToNodeSSLEncryption(Tester):
 
@@ -196,4 +197,3 @@ class TestNodeToNodeSSLEncryption(Tester):
         node.set_configuration_options(values={
             'server_encryption_options': server_enc_options
         })
-        

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/system_keyspaces_test.py
----------------------------------------------------------------------
diff --git a/system_keyspaces_test.py b/system_keyspaces_test.py
index 90eb583..2a5c099 100644
--- a/system_keyspaces_test.py
+++ b/system_keyspaces_test.py
@@ -3,6 +3,7 @@ from dtest import Tester
 from tools.assertions import assert_all, assert_exception, assert_none
 from tools.decorators import since
 
+
 class TestSystemKeyspaces(Tester):
 
     @since('3.0')
@@ -25,7 +26,7 @@ class TestSystemKeyspaces(Tester):
         assert_exception(session, stmt, expected=Unauthorized)
 
         # DROP KEYSPACE should fail for system and system_schema
-        assert_exception(session, 'DROP KEYSPACE system;',        
expected=Unauthorized)
+        assert_exception(session, 'DROP KEYSPACE system;', 
expected=Unauthorized)
         assert_exception(session, 'DROP KEYSPACE system_schema;', 
expected=Unauthorized)
 
         # CREATE TABLE should fail in system and system_schema
@@ -47,7 +48,7 @@ class TestSystemKeyspaces(Tester):
                          expected=Unauthorized)
 
         # DROP TABLE should fail in system and system_schema
-        assert_exception(session, 'DROP TABLE system.local;',         
expected=Unauthorized)
+        assert_exception(session, 'DROP TABLE system.local;', 
expected=Unauthorized)
         assert_exception(session, 'DROP TABLE system_schema.tables;', 
expected=Unauthorized)
 
     @since('3.0')

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/tools/data.py
----------------------------------------------------------------------
diff --git a/tools/data.py b/tools/data.py
index 597a10c..2f86166 100644
--- a/tools/data.py
+++ b/tools/data.py
@@ -151,6 +151,7 @@ def index_is_built(node, session, keyspace, table_name, 
idx_name):
     index_query = """SELECT * FROM system."IndexInfo" WHERE table_name = '{}' 
AND index_name = '{}'""".format(keyspace, full_idx_name)
     return len(list(session.execute(index_query))) == 1
 
+
 def block_until_index_is_built(node, session, keyspace, table_name, idx_name):
     """
     Waits up to 30 seconds for a secondary index to be built, and raises
@@ -164,4 +165,4 @@ def block_until_index_is_built(node, session, keyspace, 
table_name, idx_name):
         if index_is_built(node, session, keyspace, table_name, idx_name):
             break
     else:
-        raise DtestTimeoutError()
\ No newline at end of file
+        raise DtestTimeoutError()

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/upgrade_tests/thrift_upgrade_test.py
----------------------------------------------------------------------
diff --git a/upgrade_tests/thrift_upgrade_test.py 
b/upgrade_tests/thrift_upgrade_test.py
index aefc037..0943d8a 100644
--- a/upgrade_tests/thrift_upgrade_test.py
+++ b/upgrade_tests/thrift_upgrade_test.py
@@ -20,10 +20,11 @@ from upgrade_manifest import build_upgrade_pairs
 
 def _create_dense_super_cf(name):
     return Cassandra.CfDef('ks', name, column_type='Super',
-                           key_validation_class='AsciiType',     # pk
-                           comparator_type='AsciiType',          # ck
-                           default_validation_class='AsciiType', # SC value
-                           subcomparator_type='LongType')        # SC key
+                           key_validation_class='AsciiType',        # pk
+                           comparator_type='AsciiType',             # ck
+                           default_validation_class='AsciiType',    # SC value
+                           subcomparator_type='LongType')           # SC key
+
 
 def _create_sparse_super_cf(name):
     cd1 = ColumnDef('col1', 'LongType', None, None)
@@ -34,6 +35,7 @@ def _create_sparse_super_cf(name):
                            comparator_type='AsciiType',
                            subcomparator_type='AsciiType')
 
+
 def _validate_sparse_cql(cursor, cf='sparse_super_1', column1=u'column1', 
col1=u'col1', col2=u'col2', key='key'):
     cursor.execute('use ks')
 

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/44fd9be9/write_failures_test.py
----------------------------------------------------------------------
diff --git a/write_failures_test.py b/write_failures_test.py
index a83e212..4a507f4 100644
--- a/write_failures_test.py
+++ b/write_failures_test.py
@@ -2,7 +2,6 @@ import uuid
 
 from cassandra import ConsistencyLevel, WriteFailure, WriteTimeout
 
-from distutils.version import LooseVersion
 from dtest import Tester, supports_v5_protocol
 from thrift_bindings.v22 import ttypes as thrift_types
 from thrift_tests import get_thrift_client


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to