diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
| commit | 22ba1c43b792953ae6f791512d276739c8c09eae (patch) | |
| tree | bdf9f639b01426a8a2e1c8c61d35533026dd4265 /test/lib | |
| parent | 27913554a85c308d81e6c018669d0246ceecc639 (diff) | |
| download | sqlalchemy-22ba1c43b792953ae6f791512d276739c8c09eae.tar.gz | |
-whitespace bonanza, contd
Diffstat (limited to 'test/lib')
| -rw-r--r-- | test/lib/__init__.py | 2 | ||||
| -rw-r--r-- | test/lib/fixtures.py | 6 | ||||
| -rw-r--r-- | test/lib/profiling.py | 4 | ||||
| -rw-r--r-- | test/lib/requires.py | 14 | ||||
| -rw-r--r-- | test/lib/testing.py | 12 |
5 files changed, 19 insertions, 19 deletions
diff --git a/test/lib/__init__.py b/test/lib/__init__.py index 68876c447..b36db71fc 100644 --- a/test/lib/__init__.py +++ b/test/lib/__init__.py @@ -1,6 +1,6 @@ """Testing environment and utilities. -This package contains base classes and routines used by +This package contains base classes and routines used by the unit tests. Tests are based on Nose and bootstrapped by noseplugin.NoseSQLAlchemy. diff --git a/test/lib/fixtures.py b/test/lib/fixtures.py index 41a72c9a4..451eeb43b 100644 --- a/test/lib/fixtures.py +++ b/test/lib/fixtures.py @@ -268,7 +268,7 @@ class MappedTest(_ORMTest, TablesTest, testing.AssertsExecutionResults): """Run a setup method, framing the operation with a Base class that will catch new subclasses to be established within the "classes" registry. - + """ cls_registry = cls.classes class FindFixture(type): @@ -289,7 +289,7 @@ class MappedTest(_ORMTest, TablesTest, testing.AssertsExecutionResults): def _teardown_each_mappers(self): # some tests create mappers in the test bodies - # and will define setup_mappers as None - + # and will define setup_mappers as None - # clear mappers in any case if self.run_setup_mappers != 'once': sa.orm.clear_mappers() @@ -328,7 +328,7 @@ class DeclarativeMappedTest(MappedTest): cls, classname, bases, dict_) class DeclarativeBasic(object): __table_cls__ = schema.Table - _DeclBase = declarative_base(metadata=cls.declarative_meta, + _DeclBase = declarative_base(metadata=cls.declarative_meta, metaclass=FindFixtureDeclarative, cls=DeclarativeBasic) cls.DeclarativeBasic = _DeclBase diff --git a/test/lib/profiling.py b/test/lib/profiling.py index bac9e549f..f47145718 100644 --- a/test/lib/profiling.py +++ b/test/lib/profiling.py @@ -69,12 +69,12 @@ def profiled(target=None, **target_opts): else: stats.print_stats() - print_callers = target_opts.get('print_callers', + print_callers = target_opts.get('print_callers', profile_config['print_callers']) if print_callers: stats.print_callers() - print_callees = target_opts.get('print_callees', + print_callees = target_opts.get('print_callees', profile_config['print_callees']) if print_callees: stats.print_callees() diff --git a/test/lib/requires.py b/test/lib/requires.py index 88049d7fb..31b835b28 100644 --- a/test/lib/requires.py +++ b/test/lib/requires.py @@ -77,9 +77,9 @@ def identity(fn): def reflectable_autoincrement(fn): """Target database must support tables that can automatically generate PKs assuming they were reflected. - + this is essentially all the DBs in "identity" plus Postgresql, which - has SERIAL support. FB and Oracle (and sybase?) require the Sequence to + has SERIAL support. FB and Oracle (and sybase?) require the Sequence to be explicitly added, including if the table was reflected. """ return _chain_decorators_on( @@ -151,7 +151,7 @@ def update_from(fn): """Target must support UPDATE..FROM syntax""" return _chain_decorators_on( fn, - only_on(('postgresql', 'mssql', 'mysql'), + only_on(('postgresql', 'mssql', 'mysql'), "Backend does not support UPDATE..FROM") ) @@ -388,7 +388,7 @@ def python25(fn): def cpython(fn): return _chain_decorators_on( fn, - skip_if(lambda: util.jython or util.pypy, + skip_if(lambda: util.jython or util.pypy, "cPython interpreter needed" ) ) @@ -424,11 +424,11 @@ def sqlite(fn): def ad_hoc_engines(fn): """Test environment must allow ad-hoc engine/connection creation. - + DBs that scale poorly for many connections, even when closed, i.e. Oracle, may use the "--low-connections" option which flags this requirement as not present. - + """ return _chain_decorators_on( fn, @@ -456,6 +456,6 @@ def selectone(fn): """target driver must support the literal statement 'select 1'""" return _chain_decorators_on( fn, - skip_if(lambda: testing.against('oracle'), + skip_if(lambda: testing.against('oracle'), "non-standard SELECT scalar syntax") ) diff --git a/test/lib/testing.py b/test/lib/testing.py index d3bccb53c..02d592235 100644 --- a/test/lib/testing.py +++ b/test/lib/testing.py @@ -95,7 +95,7 @@ def db_spec(*dbs): def fails_on(dbs, reason): - """Mark a test as expected to fail on the specified database + """Mark a test as expected to fail on the specified database implementation. Unlike ``crashes``, tests marked as ``fails_on`` will be run @@ -425,7 +425,7 @@ def resetwarnings(): util.warn = util.langhelpers.warn = testing_warn warnings.filterwarnings('ignore', - category=sa_exc.SAPendingDeprecationWarning) + category=sa_exc.SAPendingDeprecationWarning) warnings.filterwarnings('error', category=sa_exc.SADeprecationWarning) warnings.filterwarnings('error', category=sa_exc.SAWarning) @@ -479,9 +479,9 @@ def _chain_decorators_on(fn, *decorators): def run_as_contextmanager(ctx, fn, *arg, **kw): """Run the given function under the given contextmanager, - simulating the behavior of 'with' to support older + simulating the behavior of 'with' to support older Python versions. - + """ obj = ctx.__enter__() @@ -576,8 +576,8 @@ class adict(dict): class AssertsCompiledSQL(object): - def assert_compile(self, clause, result, params=None, - checkparams=None, dialect=None, + def assert_compile(self, clause, result, params=None, + checkparams=None, dialect=None, checkpositional=None, use_default_dialect=False, allow_dialect_select=False): |
