module documentation

Undocumented

Class AssertsCompiledSQL Undocumented
Class AssertsExecutionResults No class docstring; 1/11 method documented
Class ComparesIndexes Undocumented
Class ComparesTables Undocumented
Function assert_raises Undocumented
Function assert_raises_context_ok Undocumented
Function assert_raises_message Undocumented
Function assert_raises_message_context_ok Undocumented
Function assert_warns legacy adapter function for functions that were previously using assert_raises with SAWarning or similar.
Function assert_warns_message legacy adapter function for functions that were previously using assert_raises with SAWarning or similar.
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 int_within_variance Undocumented
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.
Class _ErrorContainer 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
Constant _EXC_CLS Undocumented
Constant _FILTERS Undocumented
Constant _SEEN Undocumented
def assert_raises(except_cls, callable_, *args, **kw): (source)

Undocumented

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

Undocumented

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

Undocumented

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

Undocumented

def assert_warns(except_cls, callable_, *args, **kwargs): (source)

legacy adapter function for functions that were previously using assert_raises with SAWarning or similar. has some workarounds to accommodate the fact that the callable completes with this approach rather than stopping at the exception raise.

def assert_warns_message(except_cls, msg, callable_, *args, **kwargs): (source)

legacy adapter function for functions that were previously using assert_raises with SAWarning or similar. has some workarounds to accommodate the fact that the callable completes with this approach rather than stopping at the exception raise. Also uses regex.search() to match the given message to the error string rather than regex.match().

def emits_warning(*messages): (source)

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): (source)

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): (source)

Assert a == b, with repr messaging on failure.

def eq_ignore_whitespace(a, b, msg=None): (source)

Undocumented

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

Undocumented

def expect_deprecated(*messages, **kw): (source)

Undocumented

def expect_deprecated_20(*messages, **kw): (source)

Undocumented

def expect_raises(except_cls, check_context=True): (source)

Undocumented

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

Undocumented

def expect_warnings(*messages, **kw): (source)

Context manager which expects one or more warnings. With no arguments, squelches all SAWarning 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): (source)

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(): (source)

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): (source)

Assert a in b, with repr messaging on failure.

def int_within_variance(expected, received, variance): (source)

Undocumented

def is_(a, b, msg=None): (source)

Assert a is b, with repr messaging on failure.

def is_false(a, msg=None): (source)

Undocumented

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

Undocumented

def is_none(a, msg=None): (source)

Undocumented

def is_not(a, b, msg=None): (source)

Assert a is not b, with repr messaging on failure.

def is_not_none(a, msg=None): (source)

Undocumented

def is_true(a, msg=None): (source)

Undocumented

def le_(a, b, msg=None): (source)

Assert a <= b, with repr messaging on failure.

def ne_(a, b, msg=None): (source)

Assert a != b, with repr messaging on failure.

def not_in(a, b, msg=None): (source)

Assert a in not b, with repr messaging on failure.

def startswith_(a, fragment, msg=None): (source)

Assert a.startswith(fragment), with repr messaging on failure.

def uses_deprecated(*messages): (source)

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.

def _assert_no_stray_pool_connections(): (source)

Undocumented

def _assert_proper_exception_context(exception): (source)

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): (source)

Undocumented

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

Undocumented

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

Undocumented

_EXC_CLS = (source)

Undocumented

Value
None
_FILTERS = (source)

Undocumented

Value
None

Undocumented

Value
None