module documentation

Undocumented

Class _​Error​Container Undocumented
Class ​Asserts​Compiled​SQL Undocumented
Class ​Asserts​Execution​Results No class docstring; 1/11 method documented
Class ​Compares​Tables Undocumented
Function ​_assert​_no​_stray​_pool​_connections Undocumented
Function ​_assert​_proper​_exception​_context assert that any exception we're catching does not have a __context__ without a __cause__, and that __suppress_context__ is never set.
Function ​_assert​_raises Undocumented
Function ​_expect​_raises Undocumented
Function ​_expect​_warnings Undocumented
Function assert​_raises Undocumented
Function assert​_raises​_context​_ok Undocumented
Function assert​_raises​_message Undocumented
Function assert​_raises​_message​_context​_ok Undocumented
Function emits​_warning Decorator form of expect_warnings().
Function emits​_warning​_on Mark a test as emitting a warning on a specific dialect.
Function eq​_ Assert a == b, with repr messaging on failure.
Function eq​_ignore​_whitespace Undocumented
Function eq​_regex Undocumented
Function expect​_deprecated Undocumented
Function expect​_deprecated​_20 Undocumented
Function expect​_raises Undocumented
Function expect​_raises​_message Undocumented
Function expect​_warnings Context manager which expects one or more warnings.
Function expect​_warnings​_on Context manager which expects one or more warnings on specific dialects.
Function global​_cleanup​_assertions Check things that have to be finalized at the end of a test suite.
Function in​_ Assert a in b, with repr messaging on failure.
Function is​_ Assert a is b, with repr messaging on failure.
Function is​_false Undocumented
Function is​_instance​_of Undocumented
Function is​_none Undocumented
Function is​_not Assert a is not b, with repr messaging on failure.
Function is​_not​_none Undocumented
Function is​_true Undocumented
Function le​_ Assert a <= b, with repr messaging on failure.
Function ne​_ Assert a != b, with repr messaging on failure.
Function not​_in Assert a in not b, with repr messaging on failure.
Function startswith​_ Assert a.startswith(fragment), with repr messaging on failure.
Function uses​_deprecated Mark a test as immune from fatal deprecation warnings.
Constant ​_EXC​_CLS Undocumented
Constant ​_FILTERS Undocumented
Constant ​_SEEN Undocumented
def _assert_no_stray_pool_connections():

Undocumented

def _assert_proper_exception_context(exception):

assert that any exception we're catching does not have a __context__ without a __cause__, and that __suppress_context__ is never set.

Python 3 will report nested as exceptions as "during the handling of error X, error Y occurred". That's not what we want to do. we want these exceptions in a cause chain.

def _assert_raises(except_cls, callable_, args, kwargs, msg=None, check_context=False):

Undocumented

@contextlib.contextmanager
def _expect_raises(except_cls, msg=None, check_context=False):

Undocumented

@contextlib.contextmanager
def _expect_warnings(exc_cls, messages, regex=True, assert_=True, py2konly=False, raise_on_any_unexpected=False):

Undocumented

def assert_raises(except_cls, callable_, *args, **kw):

Undocumented

def assert_raises_context_ok(except_cls, callable_, *args, **kw):

Undocumented

def assert_raises_message(except_cls, msg, callable_, *args, **kwargs):

Undocumented

def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs):

Undocumented

def emits_warning(*messages):

Decorator form of expect_warnings().

Note that emits_warning does not assert that the warnings were in fact seen.

def emits_warning_on(db, *messages):

Mark a test as emitting a warning on a specific dialect.

With no arguments, squelches all SAWarning failures. Or pass one or more strings; these will be matched to the root of the warning description by warnings.filterwarnings().

Note that emits_warning_on does not assert that the warnings were in fact seen.

def eq_(a, b, msg=None):
Assert a == b, with repr messaging on failure.
def eq_ignore_whitespace(a, b, msg=None):

Undocumented

def eq_regex(a, b, msg=None):

Undocumented

def expect_deprecated(*messages, **kw):

Undocumented

def expect_deprecated_20(*messages, **kw):

Undocumented

def expect_raises(except_cls, check_context=True):

Undocumented

def expect_raises_message(except_cls, msg, check_context=True):

Undocumented

def expect_warnings(*messages, **kw):

Context manager which expects one or more warnings.

With no arguments, squelches all SAWarning and RemovedIn20Warning emitted via sqlalchemy.util.warn and sqlalchemy.util.warn_limited. Otherwise pass string expressions that will match selected warnings via regex; all non-matching warnings are sent through.

The expect version asserts that the warnings were in fact seen.

Note that the test suite sets SAWarning warnings to raise exceptions.

@contextlib.contextmanager
def expect_warnings_on(db, *messages, **kw):

Context manager which expects one or more warnings on specific dialects.

The expect version asserts that the warnings were in fact seen.

def global_cleanup_assertions():

Check things that have to be finalized at the end of a test suite.

Hardcoded at the moment, a modular system can be built here to support things like PG prepared transactions, tables all dropped, etc.

def in_(a, b, msg=None):
Assert a in b, with repr messaging on failure.
def is_(a, b, msg=None):
Assert a is b, with repr messaging on failure.
def is_false(a, msg=None):

Undocumented

def is_instance_of(a, b, msg=None):

Undocumented

def is_none(a, msg=None):

Undocumented

def is_not(a, b, msg=None):
Assert a is not b, with repr messaging on failure.
def is_not_none(a, msg=None):

Undocumented

def is_true(a, msg=None):

Undocumented

def le_(a, b, msg=None):
Assert a <= b, with repr messaging on failure.
def ne_(a, b, msg=None):
Assert a != b, with repr messaging on failure.
def not_in(a, b, msg=None):
Assert a in not b, with repr messaging on failure.
def startswith_(a, fragment, msg=None):
Assert a.startswith(fragment), with repr messaging on failure.
def uses_deprecated(*messages):

Mark a test as immune from fatal deprecation warnings.

With no arguments, squelches all SADeprecationWarning failures. Or pass one or more strings; these will be matched to the root of the warning description by warnings.filterwarnings().

As a special case, you may pass a function name prefixed with // and it will be re-written as needed to match the standard warning verbiage emitted by the sqlalchemy.util.deprecated decorator.

Note that uses_deprecated does not assert that the warnings were in fact seen.

_EXC_CLS =

Undocumented

Value
None
_FILTERS =

Undocumented

Value
None
_SEEN =

Undocumented

Value
None