summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Blaho <petrblaho@gmail.com>2014-06-12 15:17:50 +0200
committerPetr Blaho <petrblaho@gmail.com>2014-08-03 17:08:21 +0200
commit3cb592775d063df9afdb65e0d59338b31363d089 (patch)
tree7ba4451b429a2bca397e3dbd9167fa2ecfff898b
parent0996c5d0166ac17065993ac857201024da1f63a7 (diff)
downloadoslo-db-3cb592775d063df9afdb65e0d59338b31363d089.tar.gz
Adds empty line to multilines docs to pass H405
Adds empty line to multilines docs to pass H405 check. Removes H405 from ignore setting in tox.ini. Change-Id: I0516fb12765bf961a4488570a6c73b80f667d972
-rw-r--r--oslo/db/sqlalchemy/exc_filters.py20
-rw-r--r--oslo/db/sqlalchemy/session.py10
-rw-r--r--tests/sqlalchemy/test_exc_filters.py9
-rw-r--r--tests/sqlalchemy/test_migrate_cli.py9
-rw-r--r--tests/sqlalchemy/test_sqlalchemy.py1
-rw-r--r--tox.ini2
6 files changed, 32 insertions, 19 deletions
diff --git a/oslo/db/sqlalchemy/exc_filters.py b/oslo/db/sqlalchemy/exc_filters.py
index d4d9438..20c8155 100644
--- a/oslo/db/sqlalchemy/exc_filters.py
+++ b/oslo/db/sqlalchemy/exc_filters.py
@@ -226,9 +226,10 @@ def _db2_dupe_key_error(integrity_error, match, engine_name, is_disconnect):
@filters("mysql", sqla_exc.DBAPIError, r".*\b1146\b")
def _raise_mysql_table_doesnt_exist_asis(
error, match, engine_name, is_disconnect):
- """Raise MySQL error 1146 as is, so that it does not conflict with
- the MySQL dialect's checking a table not existing.
+ """Raise MySQL error 1146 as is.
+ Raise MySQL error 1146 as is, so that it does not conflict with
+ the MySQL dialect's checking a table not existing.
"""
raise error
@@ -237,9 +238,10 @@ def _raise_mysql_table_doesnt_exist_asis(
@filters("*", sqla_exc.OperationalError, r".*")
def _raise_operational_errors_directly_filter(operational_error,
match, engine_name, is_disconnect):
- """Filter for all remaining OperationalError classes and apply
- special rules.
+ """Filter for all remaining OperationalError classes and apply.
+ Filter for all remaining OperationalError classes and apply
+ special rules.
"""
if is_disconnect:
# operational errors that represent disconnect
@@ -262,9 +264,10 @@ def _is_db_connection_error(operational_error, match, engine_name,
@filters("*", sqla_exc.DBAPIError, r".*")
def _raise_for_remaining_DBAPIError(error, match, engine_name, is_disconnect):
- """Filter for remaining DBAPIErrors and wrap if they represent
- a disconnect error.
+ """Filter for remaining DBAPIErrors.
+ Filter for remaining DBAPIErrors and wrap if they represent
+ a disconnect error.
"""
if is_disconnect:
raise exception.DBConnectionError(error)
@@ -327,9 +330,10 @@ def register_engine(engine):
def handle_connect_error(engine):
- """Provide a special context that will allow on-connect errors
- to be raised within the filtering context.
+ """Handle connect error.
+ Provide a special context that will allow on-connect errors
+ to be raised within the filtering context.
"""
try:
return engine.connect()
diff --git a/oslo/db/sqlalchemy/session.py b/oslo/db/sqlalchemy/session.py
index 442ee21..2ff3caa 100644
--- a/oslo/db/sqlalchemy/session.py
+++ b/oslo/db/sqlalchemy/session.py
@@ -338,9 +338,10 @@ def _thread_yield(dbapi_con, con_record):
def _begin_ping_listener(connection):
- """Ping the server at transaction begin and transparently reconnect
- if a disconnect exception occurs.
+ """Ping the server at transaction begin.
+ Ping the server at transaction begin and transparently reconnect
+ if a disconnect exception occurs.
"""
try:
# run a SELECT 1. use a core select() so that
@@ -531,9 +532,10 @@ def get_maker(engine, autocommit=True, expire_on_commit=False):
def _add_trace_comments(engine):
- """Augment statements with a trace of the immediate calling code
- for a given statement.
+ """Add trace comments.
+ Augment statements with a trace of the immediate calling code
+ for a given statement.
"""
import os
diff --git a/tests/sqlalchemy/test_exc_filters.py b/tests/sqlalchemy/test_exc_filters.py
index 42e4365..8e1e1ad 100644
--- a/tests/sqlalchemy/test_exc_filters.py
+++ b/tests/sqlalchemy/test_exc_filters.py
@@ -144,7 +144,9 @@ class TestFallthroughsAndNonDBAPI(TestsExceptionFilter):
matched.message)
def test_operational_error_asis(self):
- """test that SQLAlchemy OperationalErrors that aren't disconnects
+ """Test operational errors.
+
+ test that SQLAlchemy OperationalErrors that aren't disconnects
are passed through without wrapping.
"""
@@ -504,8 +506,9 @@ class IntegrationTest(test_base.DbTestCase):
self.assertRaises(exception.DBDuplicateEntry, _session.flush)
def test_autoflush_wrapper_duplicate_entry(self):
- """test a duplicate entry exception raised via
- query.all()-> autoflush
+ """Test a duplicate entry exception raised.
+
+ test a duplicate entry exception raised via query.all()-> autoflush
"""
_session = self.sessionmaker()
diff --git a/tests/sqlalchemy/test_migrate_cli.py b/tests/sqlalchemy/test_migrate_cli.py
index f23ee87..32e9a9d 100644
--- a/tests/sqlalchemy/test_migrate_cli.py
+++ b/tests/sqlalchemy/test_migrate_cli.py
@@ -37,14 +37,17 @@ class TestAlembicExtension(test_base.BaseTestCase):
super(TestAlembicExtension, self).setUp()
def test_check_enabled_true(self, command):
- """Verifies that enabled returns True on non empty
+ """Check enabled returns True
+
+ Verifies that enabled returns True on non empty
alembic_ini_path conf variable
"""
self.assertTrue(self.alembic.enabled)
def test_check_enabled_false(self, command):
- """Verifies enabled returns False on empty
- alembic_ini_path variable
+ """Check enabled returns False
+
+ Verifies enabled returns False on empty alembic_ini_path variable
"""
self.migration_config['alembic_ini_path'] = ''
alembic = ext_alembic.AlembicExtension(self.migration_config)
diff --git a/tests/sqlalchemy/test_sqlalchemy.py b/tests/sqlalchemy/test_sqlalchemy.py
index ff8d9ba..9b8efcb 100644
--- a/tests/sqlalchemy/test_sqlalchemy.py
+++ b/tests/sqlalchemy/test_sqlalchemy.py
@@ -183,6 +183,7 @@ class MySQLStrictAllTablesModeTestCase(MySQLModeTestCase):
class MySQLTraditionalModeTestCase(MySQLStrictAllTablesModeTestCase):
"""Test data integrity enforcement in MySQL TRADITIONAL mode.
+
Since TRADITIONAL includes STRICT_ALL_TABLES, this inherits all
STRICT_ALL_TABLES mode tests.
"""
diff --git a/tox.ini b/tox.ini
index 30851cd..2d3bdd8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -45,7 +45,7 @@ commands =
# see https://bugs.launchpad.net/hacking/+bug/1329363
show-source = True
-ignore = E123,E125,E128,E265,H305,H307,H405,H703,H803,H904
+ignore = E123,E125,E128,E265,H305,H307,H703,H803,H904
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build