~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to lib/sqlalchemy/testing/runner.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski, Jakub Wilk, Piotr Ożarowski
  • Date: 2013-07-06 20:53:52 UTC
  • mfrom: (1.4.23) (16.1.17 experimental)
  • Revision ID: package-import@ubuntu.com-20130706205352-ryppl1eto3illd79
Tags: 0.8.2-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Piotr Ożarowski ]
* New upstream release
* Upload to unstable
* Build depend on python3-all instead of -dev, extensions are not built for
  Python 3.X 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
"""
 
3
Nose test runner module.
 
4
 
 
5
This script is a front-end to "nosetests" which
 
6
installs SQLAlchemy's testing plugin into the local environment.
 
7
 
 
8
The script is intended to be used by third-party dialects and extensions
 
9
that run within SQLAlchemy's testing framework.    The runner can
 
10
be invoked via::
 
11
 
 
12
    python -m sqlalchemy.testing.runner
 
13
 
 
14
The script is then essentially the same as the "nosetests" script, including
 
15
all of the usual Nose options.   The test environment requires that a
 
16
setup.cfg is locally present including various required options.
 
17
 
 
18
Note that when using this runner, Nose's "coverage" plugin will not be
 
19
able to provide coverage for SQLAlchemy itself, since SQLAlchemy is
 
20
imported into sys.modules before coverage is started.   The special
 
21
script sqla_nose.py is provided as a top-level script which loads the
 
22
plugin in a special (somewhat hacky) way so that coverage against
 
23
SQLAlchemy itself is possible.
 
24
 
 
25
"""
 
26
 
 
27
from sqlalchemy.testing.plugin.noseplugin import NoseSQLAlchemy
 
28
 
 
29
import nose
 
30
 
 
31
 
 
32
def main():
 
33
    nose.main(addplugins=[NoseSQLAlchemy()])
 
34
 
 
35
def setup_py_test():
 
36
    """Runner to use for the 'test_suite' entry of your setup.py.
 
37
 
 
38
    Prevents any name clash shenanigans from the command line
 
39
    argument "test" that the "setup.py test" command sends
 
40
    to nose.
 
41
 
 
42
    """
 
43
    nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner'])