- 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.
This commit is contained in:
Mike Bayer
2014-03-06 11:57:54 -05:00
parent 4175ca2050
commit a4e84a154c
4 changed files with 9 additions and 5 deletions
+3 -2
View File
@@ -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
+2 -2
View File
@@ -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):
@@ -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
+4
View File
@@ -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")