From: Mike Bayer Date: Thu, 6 Mar 2014 16:57:54 +0000 (-0500) Subject: - cx_oracle test for "unicode returns" needs to be cx_oracle only, X-Git-Tag: rel_0_9_4~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4e84a154c51192c210cfe01088d0bf9da2eceda;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - cx_oracle test for "unicode returns" needs to be cx_oracle only, and also will fail on py3k. - enhance exclusions so that a requirement attribute can be passed to fails_if/skip_if. - fix coverage docs to mention pytest. --- diff --git a/README.unittests.rst b/README.unittests.rst index 0ddffaa68b..1ab4e9536b 100644 --- a/README.unittests.rst +++ b/README.unittests.rst @@ -266,8 +266,9 @@ statement execution. BUILT-IN COVERAGE REPORTING ------------------------------ -Coverage is tracked using Nose's coverage plugin. See the nose -documentation for details. Basic usage is:: +Coverage is tracked using the coverage plugins built for pytest or nose:: + + $ py.test test/sql/test_query --cov=sqlalchemy $ ./sqla_nose.py test.sql.test_query --with-coverage diff --git a/lib/sqlalchemy/testing/exclusions.py b/lib/sqlalchemy/testing/exclusions.py index 9a713adaab..bcd593708a 100644 --- a/lib/sqlalchemy/testing/exclusions.py +++ b/lib/sqlalchemy/testing/exclusions.py @@ -6,7 +6,7 @@ import operator -from nose import SkipTest +from .plugin.plugin_base import SkipTest from ..util import decorator from . import config from .. import util @@ -98,7 +98,7 @@ class Predicate(object): @classmethod def as_predicate(cls, predicate): if isinstance(predicate, skip_if): - return predicate.predicate + return NotPredicate(predicate.predicate) elif isinstance(predicate, Predicate): return predicate elif isinstance(predicate, list): diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 6a2814109e..b8a0fae969 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -114,7 +114,6 @@ def post_begin(): global util, fixtures, engines, exclusions, \ assertions, warnings, profiling,\ config, testing - from sqlalchemy import testing from sqlalchemy.testing import fixtures, engines, exclusions, \ assertions, warnings, profiling, config from sqlalchemy import util diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py index 660a2a5e9a..7e8ddffcd9 100644 --- a/test/dialect/test_oracle.py +++ b/test/dialect/test_oracle.py @@ -1226,6 +1226,10 @@ class TypesTest(fixtures.TestBase): value = testing.db.scalar("SELECT 5.66 FROM DUAL") assert isinstance(value, decimal.Decimal) + @testing.only_on("oracle+cx_oracle", "cx_oracle-specific feature") + @testing.fails_if( + testing.requires.python3, + "cx_oracle always returns unicode on py3k") def test_coerce_to_unicode(self): engine = testing_engine(options=dict(coerce_to_unicode=True)) value = engine.scalar("SELECT 'hello' FROM DUAL")