コード例 #1
0
ファイル: test.py プロジェクト: Aerilius/preprocess
"""The preprocess test suite entry point."""

import os
from os.path import exists, join, dirname, abspath
import sys
import logging
from pprint import pprint

import testlib


log = logging.getLogger("test")
default_tags = ["-knownfailure"]


def setup():
    # Ensure the *development* preprocess.py is tested.
    lib_dir = join(dirname(dirname(abspath(__file__))), "lib")
    sys.path.insert(0, lib_dir)
    sys.stdout.write("Setup to test: ")
    sys.stdout.flush()
    preprocess_py = join(lib_dir, "preprocess.py")
    os.system("%s %s -V" % (sys.executable, preprocess_py))
    sys.stdout.write("-"*70 + '\n')

if __name__ == "__main__":
    retval = testlib.harness(setup_func=setup, default_tags=default_tags)
    sys.exit(retval)

コード例 #2
0
    from xpcom import _xpcom
    from xpcom import components
    from xpcom.server import UnwrapObject
    koTestSvc = components.classes["@activestate.com/koTestService;1"] \
        .getService(components.interfaces.koITestService)
    koTestSvc.init()

    # Reset the startup-env.tmp file (normally done by komodo.exe), otherwise
    # we'll be reading stale environment settings from whenever Komodo was last
    # run on this machine.
    koEnvironSvc = components.classes["@activestate.com/koUserEnviron;1"] \
        .getService(components.interfaces.koIUserEnviron)
    pyEnvironSvc = UnwrapObject(koEnvironSvc)
    try:
        os.remove(pyEnvironSvc.startupEnvFileName)
    except OSError:
        # Doesn't exist, or we don't have the correct permissions... ignore.
        pass
    pyEnvironSvc._UpdateFromStartupEnv()


if __name__ == "__main__":
    import warnings
    warnings.simplefilter("default", category=DeprecationWarning)
    logging.captureWarnings(True)
    _setup_for_xpcom()
    retval = testlib.harness(testdir_from_ns=testdir_from_ns,
                             setup_func=setup,
                             default_tags=default_tags)
    sys.exit(retval)
コード例 #3
0
ファイル: test.py プロジェクト: hfeeki/tsuru-shell
#!/usr/bin/env python

"""The cmdln.py test suite entry point."""

import os
from os.path import dirname, abspath, join
import sys

sys.path.insert(0, join(dirname(dirname(abspath(__file__))), "support", "testlib"))
try:
    import testlib
finally:
    del sys.path[0]


def setup():
    cmdln_lib_dir = join(dirname(dirname(abspath(__file__))), "lib")
    if "PYTHONPATH" in os.environ:
        os.environ["PYTHONPATH"] = os.pathsep.join(
            [cmdln_lib_dir, os.environ["PYTHONPATH"]])
    else:
        os.environ["PYTHONPATH"] = cmdln_lib_dir
    sys.path.insert(0, cmdln_lib_dir)

#TODO: hook test_doctests.py into this
if __name__ == "__main__":
    retval = testlib.harness(
        testdir_from_ns={None: dirname(abspath(__file__))},
        setup_func=setup)
    sys.exit(retval)
コード例 #4
0
ファイル: test.py プロジェクト: trentm/python-manta
from os.path import abspath, dirname
import sys
import logging

import testlib

log = logging.getLogger("test")
testdir_from_ns = {
    None: dirname(__file__),
}


def setup():
    # TODO Perhaps just put this in the test_*.py file.
    lib_dir = dirname(dirname(abspath(__file__)))
    sys.path.insert(0, lib_dir)


if __name__ == "__main__":
    if "TEST_DEBUG" in os.environ:
        level = logging.DEBUG
    else:
        level = logging.INFO
    logging.basicConfig(level=level)

    setup()
    default_tags = []
    retval = testlib.harness(testdir_from_ns=testdir_from_ns,
                             default_tags=default_tags)
    sys.exit(retval)
コード例 #5
0
ファイル: test.py プロジェクト: hadley/appdirs
# Copyright (c) 2010 ActiveState Software Inc.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

"""The appdirs test suite entry point."""

import os
from os.path import exists, join, abspath, dirname, normpath
import sys
import logging

import testlib

log = logging.getLogger("test")
testdir_from_ns = {
    None: os.curdir,
}

def setup():
    top_dir = dirname(dirname(abspath(__file__)))
    lib_dir = join(top_dir, "lib")
    sys.path.insert(0, lib_dir)

if __name__ == "__main__":
    logging.basicConfig()
    setup()
    default_tags = []
    retval = testlib.harness(testdir_from_ns=testdir_from_ns,
                             default_tags=default_tags)
    sys.exit(retval)

コード例 #6
0
ファイル: test.py プロジェクト: zhuyue1314/KomodoEdit
#!/usr/bin/env python

from os.path import dirname, abspath, join
import sys
try:
    import testlib
except ImportError:
    top_dir = dirname(dirname(dirname(abspath(__file__))))
    sys.path.insert(0, join(top_dir, "util"))
    import testlib
    del sys.path[0]

default_tags = ["-knownfailure"]


def setup():
    pass


if __name__ == "__main__":
    retval = testlib.harness(setup_func=setup, default_tags=default_tags)
    sys.exit(retval)
コード例 #7
0
ファイル: test.py プロジェクト: trentm/testlib
#!/usr/bin/env python
# Copyright (c) 2010 ActiveState Software Inc.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

"""The testlib test suite entry point."""

import os
from os.path import exists, join, abspath, dirname, normpath
import sys
import logging

log = logging.getLogger("test")

def setup():
    top_dir = dirname(dirname(abspath(__file__)))
    lib_dir = join(top_dir, "lib")
    sys.path.insert(0, lib_dir)

if __name__ == "__main__":
    logging.basicConfig()
    setup()
    import testlib
    sys.exit( testlib.harness() )

コード例 #8
0
ファイル: test.py プロジェクト: MynorCifuentes/KomodoEdit
    from xpcom import _xpcom
    from xpcom import components
    from xpcom.server import UnwrapObject
    koTestSvc = components.classes["@activestate.com/koTestService;1"] \
        .getService(components.interfaces.koITestService)
    koTestSvc.init()

    # Reset the startup-env.tmp file (normally done by komodo.exe), otherwise
    # we'll be reading stale environment settings from whenever Komodo was last
    # run on this machine.
    koEnvironSvc = components.classes["@activestate.com/koUserEnviron;1"] \
        .getService(components.interfaces.koIUserEnviron)
    pyEnvironSvc = UnwrapObject(koEnvironSvc)
    try:
        os.remove(pyEnvironSvc.startupEnvFileName)
    except OSError:
        # Doesn't exist, or we don't have the correct permissions... ignore.
        pass
    pyEnvironSvc._UpdateFromStartupEnv()

if __name__ == "__main__":
    import warnings
    warnings.simplefilter("default", category=DeprecationWarning)
    logging.captureWarnings(True)
    _setup_for_xpcom()
    retval = testlib.harness(testdir_from_ns=testdir_from_ns,
                             setup_func=setup,
                             default_tags=default_tags)
    sys.exit(retval)

コード例 #9
0
#!/usr/bin/env python
"""The cmdln.py test suite entry point."""

import os
from os.path import dirname, abspath, join
import sys

sys.path.insert(
    0, join(dirname(dirname(abspath(__file__))), "support", "testlib"))
try:
    import testlib
finally:
    del sys.path[0]


def setup():
    cmdln_lib_dir = join(dirname(dirname(abspath(__file__))), "lib")
    if "PYTHONPATH" in os.environ:
        os.environ["PYTHONPATH"] = os.pathsep.join(
            [cmdln_lib_dir, os.environ["PYTHONPATH"]])
    else:
        os.environ["PYTHONPATH"] = cmdln_lib_dir
    sys.path.insert(0, cmdln_lib_dir)


#TODO: hook test_doctests.py into this
if __name__ == "__main__":
    retval = testlib.harness(
        testdir_from_ns={None: dirname(abspath(__file__))}, setup_func=setup)
    sys.exit(retval)
コード例 #10
0
ファイル: test.py プロジェクト: zhuyue1314/KomodoEdit
#!/usr/bin/env python
# Copyright (c) 2007 ActiveState Software Inc.
"""The doit test suite entry point."""

import os
from os.path import dirname, abspath
import sys
import logging

import testlib

testdir_from_ns = {
    None: os.curdir,
}


def setup():
    sys.path.insert(0, dirname(dirname(abspath(__file__))))


if __name__ == "__main__":
    retval = testlib.harness(testdir_from_ns=testdir_from_ns, setup_func=setup)
    sys.exit(retval)
コード例 #11
0
ファイル: test.py プロジェクト: Acidburn0zzz/KomodoEdit
#!/usr/bin/env python
# Copyright (c) 2007 ActiveState Software Inc.

"""The doit test suite entry point."""

import os
from os.path import dirname, abspath
import sys
import logging

import testlib


testdir_from_ns = {
    None: os.curdir,
}

def setup():
    sys.path.insert(0, dirname(dirname(abspath(__file__))))

if __name__ == "__main__":
    retval = testlib.harness(testdir_from_ns=testdir_from_ns,
                             setup_func=setup)
    sys.exit(retval)