mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-18 06:32:08 -04:00
- 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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user