diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-29 18:38:44 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-29 18:38:44 -0500 |
| commit | 79fc3cdc1b0be99e138580905290823463766944 (patch) | |
| tree | 0b840795f76853d01be832a6cd851d2026cb3cc7 /lib/sqlalchemy/util | |
| parent | 35bfda533ed1546f40a5907dfe87c14c0b71cd0d (diff) | |
| download | sqlalchemy-79fc3cdc1b0be99e138580905290823463766944.tar.gz | |
- use class name by itself in flush warnings to prevent overflow of warnings registry
- test suite swaps out warnings.warn with warnings.warn_explicit, to solve warnings registry issue
- explicitly disallow functions from inside test.bootstrap, test.lib being interpreted as tests
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 5c12cf67b..68d9709f8 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -684,6 +684,17 @@ def warn_exception(func, *args, **kwargs): def warn(msg, stacklevel=3): + """Issue a warning. + + If msg is a string, :class:`.exc.SAWarning` is used as + the category. + + .. note:: This function is swapped out when the test suite + runs, with a compatible version that uses + warnings.warn_explicit, so that the warnings registry can + be controlled. + + """ if isinstance(msg, basestring): warnings.warn(msg, exc.SAWarning, stacklevel=stacklevel) else: |
