Beispiel #1
0
def test_py_version_ok():

    parser = optparse.OptionParser()
    plugin = NoseGAE()
    plugin.add_options(parser, env={})
    (options, args) = parser.parse_args(["--with-gae"])

    _version_info = sys.version_info
    sys.version_info = (2, 5, 2, "final", 0)
    try:
        plugin.configure(options, Config())
        assert plugin.enabled
    finally:
        sys.version_info = _version_info
Beispiel #2
0
def test_py_version_too_low():
    
    parser = optparse.OptionParser()
    plugin = NoseGAE()
    plugin.add_options(parser, env={})
    (options, args) = parser.parse_args([
        "--with-gae"
    ])
        
    _version_info = sys.version_info
    sys.version_info = (2, 5, 1, 'final', 0)
    try:
        with mock.patch('sys.exit') as sysexit:
            plugin.configure(options, Config())
            sysexit.assert_called_with(1)
    finally:
        sys.version_info = _version_info
Beispiel #3
0
def test_py_version_ok():

    parser = optparse.OptionParser()
    plugin = NoseGAE()
    plugin.add_options(parser, env={})
    (options, args) = parser.parse_args(["--with-gae"])

    _version_info = sys.version_info
    sys.version_info = (2, 5, 2, 'final', 0)
    try:
        plugin.configure(options, Config())
        assert plugin.enabled
    finally:
        sys.version_info = _version_info
Beispiel #4
0
def test_py_version_too_low():

    parser = optparse.OptionParser()
    plugin = NoseGAE()
    plugin.add_options(parser, env={})
    (options, args) = parser.parse_args(["--with-gae"])

    _version_info = sys.version_info
    sys.version_info = (2, 5, 1, 'final', 0)
    try:
        with mock.patch('sys.exit') as sysexit:
            plugin.configure(options, Config())
            sysexit.assert_called_with(1)
    finally:
        sys.version_info = _version_info
Beispiel #5
0
            import nose
            import webtest
            from nosegae import NoseGAE
        else:
            print "Quitting"
            print "You can install requirements by `pip install -r tests/requirements.pip`"
            print
            sys.exit(255)
    else:
        raise

from nose.config import Config
from nose.plugins import DefaultPluginManager
CONFIG = Config(
    files=['nose.cfg'],
    plugins=DefaultPluginManager(plugins=[NoseGAE()])
)

try:
    from rednose import RedNose
except ImportError:
    pass
else:
    extra_plugins.append(RedNose())
    argv.append('--rednose')

def run_all():
    logging.debug('Running tests with arguments: %r' % sys.argv)

    nose.run_exit(
        argv=argv,