예제 #1
0
def main(args=None):
    global base

    args = parser.parse_args(args)
    base = os.getcwd()
    if args.dir:
        base = args.dir

    if args.command[0] == "sanity":
        auditfiles()
        auditsetup()
    elif args.command[0] == "style":
        auditstyle()
    elif args.command[0] == "test":
        nose()
    elif args.command[0] == "test-all":
        import tox

        tox.cmdline(("-c", os.path.join(base, "tox.ini")))
    elif args.command[0] == "publish":
        printer.info("Going to run sanity checks and tests first")
        auditfiles()
        packagename, packageversion = auditsetup()
        auditstyle()
        nose()
        publish(packagename, packageversion)

    exit(0)
예제 #2
0
 def run(self):
     try:
         import tox
     except ImportError:
         import sys
         sys.exit("tox is required to run tests.  $ pip install tox")
     tox.cmdline()
예제 #3
0
def main(argv):
    if len(argv) == 1:
        print('Usage: {0} GEN_PATH [TOX_ARGS...]', file=sys.stderr)

    # Get the project root directory.
    project_root = os.path.dirname(os.path.dirname(
        os.path.realpath(__file__)))

    temp_dir = argv[1]
    print('Copying files to ', temp_dir)
    shutil.copytree(project_root, temp_dir)
    os.chdir(temp_dir)

    # Run generation.
    sys.path.insert(0, os.path.realpath('internal'))
    import generate
    generate.main()

    # Run tox.
    import tox
    # tox will raise SystemExit() and try to exit. We don't want that.
    try:
        tox.cmdline(argv[2:])
    except SystemExit:
        pass

    # Print out the directory name for the shell script.
    print(temp_dir)
예제 #4
0
파일: setup.py 프로젝트: mkouhei/backyard
 def run_tests(self):
     import tox
     import shlex
     if self.tox_args:
         errno = tox.cmdline(args=shlex.split(self.tox_args))
     else:
         errno = tox.cmdline(self.test_args)
     sys.exit(errno)
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     tox.cmdline(args=args)
예제 #6
0
 def run_tests(self):
     # Import here, cause outside the eggs aren't loaded
     import tox  # pylint: disable=import-error
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     tox.cmdline(args=args)
예제 #7
0
파일: packit_test.py 프로젝트: ncbi/packit
    def _run_tox(self):
        self.distribution.fetch_build_eggs(self.requirements_tox)

        import tox

        exit_code = tox.cmdline(args=self.additional_test_args)
        raise SystemExit(exit_code)
예제 #8
0
    def run_tests(self):
        import tox
        if self.environment:
            self.test_args.append('-e{0}'.format(self.environment))

        errno = tox.cmdline(self.test_args)
        sys.exit(errno)
예제 #9
0
    def run_tests(self):
        # Import here because outside the eggs aren't loaded.
        import tox
        import shlex

        errno = tox.cmdline(args=shlex.split(self.tox_args))
        sys.exit(errno)
예제 #10
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     if self.environment:
         self.test_args.append('-e{0}'.format(self.environment))
     errno = tox.cmdline(self.test_args)
     sys.exit(errno)
예제 #11
0
 def run_tests(self):
     from tox import cmdline
     args = self.tox_args
     if args:
         args = split(self.tox_args)
     errno = cmdline(args=args)
     exit(errno)
예제 #12
0
파일: test.py 프로젝트: t-8ch/devpi
    def runtox(self, link):
        # publishing some infos to the commands started by tox
        #setenv_devpi(self.hub, env, posturl=self.current.resultlog,
        #                  packageurl=link.url,
        #                  packagemd5=link.md5)
        jsonreport = link.pkg.rootdir.join("toxreport.json")
        path_archive = link.pkg.path_archive
        toxargs = ["--installpkg", str(path_archive),
                   "-i ALL=%s" % str(self.current.simpleindex),
                   "--result-json", str(jsonreport),
        ]
        unpack_path = link.pkg.path_unpacked

        toxargs.extend(self.get_tox_args(unpack_path=unpack_path))
        with link.pkg.path_unpacked.as_cwd():
            self.hub.info("%s$ tox %s" %(os.getcwd(), " ".join(toxargs)))
            try:
                ret = tox.cmdline(toxargs)
            except SystemExit as e:
                ret = e.args[0]
        if ret != 2:
            jsondata = json.load(jsonreport.open("r"))
            url = URL(link.url)
            post_tox_json_report(self.hub, url.url_nofrag, jsondata)
        if ret != 0:
            self.hub.error("tox command failed", ret)
            return 1
        return 0
예제 #13
0
파일: setup.py 프로젝트: InMobi/grill
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     import os
     del os.environ["PYTHONPATH"]
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #14
0
 def run_tests(self):
     import tox
     args = self.tox_args
     if args:
         args = split(self.tox_args)
     errno = tox.cmdline(args=args)
     exit(errno)
예제 #15
0
 def run_tests(self):
     """Invoke the test runner (tox)."""
     # import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     errno = tox.cmdline(args=shlex.split(self.tox_args))
     sys.exit(errno)
예제 #16
0
파일: setup.py 프로젝트: nap/plexcleaner
 def run_tests(self):
     import tox  # import here, cause outside the eggs aren't loaded
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #17
0
 def run_tests(self):
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #18
0
 def run_tests(self):
     # import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args_value = []
     if self.tox_args:
         args_value = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args_value)
     sys.exit(errno)
예제 #19
0
 def run_tests(self):
     # Import here. Outside the .eggs/ will not load
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #20
0
파일: setup.py 프로젝트: nzavagli/UnrealPy
 def run_tests(self):
     """Do the actual running of the tests."""
     # import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #21
0
 def run_tests(self):
     """run tox and pass on user-options"""
     # import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #22
0
파일: setup.py 프로젝트: justanr/xyz
    def run_tests(self):
        import tox
        import shlex

        args = []

        if self.tox_args:
            args = shlex.split(self.tox_args)

        sys.exit(tox.cmdline(args=args))
예제 #23
0
 def run_tests(self):
     # Change to the dir containing tox bits
     chdir("..")
     #import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #24
0
파일: setup.py 프로젝트: jcomo/victor
    def run_tests(self):
        # Import here since eggs aren't loaded outside of this scope
        import tox
        import shlex

        args = self.tox_args
        if args:
            args = shlex.split(self.tox_args)

        errno = tox.cmdline(args=args)
        sys.exit(errno)
예제 #25
0
파일: packaging.py 프로젝트: ESSS/conda
 def run_tests(self):
     # import here, because outside the eggs aren't loaded
     from tox import cmdline
     from shlex import split
     args = self.tox_args
     if args:
         args = split(self.tox_args)
     else:
         args = ''
     errno = cmdline(args=args)
     sys.exit(errno)
예제 #26
0
def main():
    if sys.argv[1:2] == ['test']:
        import tox
        sys.exit(tox.cmdline(sys.argv[2:]))
    elif sys.argv[1:2] == ['bash']:
        from subprocess import call
        sys.exit(call('/usr/bin/bash', *sys.argv[2:]))
    else:
        os.environ.setdefault("DJANGO_SETTINGS_MODULE",
                              "filmfest.settings.dev")
        from django.core.management import execute_from_command_line
        execute_from_command_line(sys.argv)
예제 #27
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     # remove the 'test' arg from argv as tox passes it to ostestr which
     # breaks it.
     sys.argv.pop()
     if args:
         args = shlex.split(self.tox_args)
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #28
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     import shlex
     args = self.tox_args
     if args:
         args = shlex.split(self.tox_args)
     elif os.environ.get("TOX_ARGUMENTS"):
         args = shlex.split(os.environ.get("TOX_ARGUMENTS"))
     else:
         args = shlex.split('-e py27')
     errno = tox.cmdline(args=args)
     sys.exit(errno)
예제 #29
0
    def run_tests(self):
        # Import here, cause outside the eggs aren't loaded
        import tox
        import shlex

        # Get tox arguments from user options:
        args = self.tox_args
        if args:
            args = shlex.split(self.tox_args)

        # Launch tox and exit with return code:
        errno = tox.cmdline(args=args)
        sys.exit(errno)
예제 #30
0
    def run(self):
        # Install test dependencies if needed.
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)

        # Add eggs to PYTHONPATH. We need to do this to ensure our eggs are
        # seen by Tox.
        self.distribution.export_live_eggs()

        import shlex
        import tox

        parsed_args = shlex.split(self.tox_args)
        result = tox.cmdline(args=parsed_args)

        sys.exit(result)
예제 #31
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     tox.cmdline(self.test_args)
예제 #32
0
파일: setup.py 프로젝트: HeMan/txkazoo
 def run_tests(self):
     # import here, cause outside the eggs aren't loaded
     import tox
     exit(tox.cmdline([]))
예제 #33
0
파일: setup.py 프로젝트: mlprt/ble2lsl
 def run_tests(self):
     # apparently necessary to import here
     import tox
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #34
0
 def run_tests(self):
     from tox import cmdline  # pylint: disable=import-error
     args = self.tox_args
     if args:
         args = split(self.tox_args)
     cmdline(args=args)
예제 #35
0
 def run_tests(self):
     # import must be here, because outside the eggs aren't loaded
     import tox
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #36
0
 def run_tests(self):
     import tox
     tox.cmdline()
예제 #37
0
 def run(self):
     import tox
     sys.exit(tox.cmdline([]))
예제 #38
0
def test_tox_cmdline_no_args(monkeypatch):
    monkeypatch.setattr(sys, 'argv', ['caller_script', '--help'])
    with pytest.raises(SystemExit):
        tox.cmdline()
예제 #39
0
파일: setup.py 프로젝트: tsionyx/pyblank
    def run(self):
        self.install_dists(self.distribution)

        # noinspection PyUnresolvedReferences,PyPackageRequirements
        import tox
        tox.cmdline()
예제 #40
0
def test_tox_cmdline_args(initproj):
    initproj("help", filedefs={"tox.ini": ""})
    with pytest.raises(SystemExit):
        tox.cmdline(["caller_script", "--help"])
예제 #41
0
    def run_tests(self):
        import shlex
        import tox

        errno = tox.cmdline(args=shlex.split(self.tox_args))
        sys.exit(errno)
예제 #42
0
 def run_tests(self):
     """runs test suite"""
     import tox
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #43
0
 def run_tests(self):
     import tox
     errno = tox.cmdline()
     sys.exit(errno)
예제 #44
0
 def run_tests(self):
     import tox
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #45
0
파일: setup.py 프로젝트: milos-u/wsgidav
    def run_tests(self):
        # Import here, cause outside the eggs aren't loaded
        import tox

        # Raises SystemExit
        tox.cmdline(self.test_args)
예제 #46
0
파일: setup.py 프로젝트: dekins/sshtunnel
 def run_tests(self):
     # import here, otherwise eggs aren't loaded
     import tox
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #47
0
 def run_tests(self):
     """Setting up to run the tests."""
     # import here, this ensures eggs are loaded
     import tox
     errno = tox.cmdline(self.test_args)
     sys.exit(errno)
예제 #48
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     import virtualenv
     errcode = tox.cmdline(self.test_args)
     sys.exit(errcode)
예제 #49
0
 def run_tests(self):
     import tox  # import here, cause outside the eggs aren't loaded.
     errno = tox.cmdline(self.test_args)
     sys.exit(errno)
예제 #50
0
파일: setup.py 프로젝트: warsaw/blue
 def run_tests(self):
     import tox
     errno = tox.cmdline(self.test_args)
     exit(errno)
예제 #51
0
 def run_tests(self):
     import tox
     sys.exit(tox.cmdline(self.test_args))
예제 #52
0
 def run_tests(self):
     #import here, cause outside the eggs aren't loaded
     import tox
     errno = tox.cmdline(args=self.tox_args.split())
     sys.exit(errno)
예제 #53
0
 def run_tests(self):
     import tox
     tox.cmdline(self.test_args)
예제 #54
0
def test_tox_cmdline_no_args(monkeypatch):
    monkeypatch.setattr(sys, "argv", ["caller_script", "--help"])
    with pytest.raises(SystemExit):
        tox.cmdline()
예제 #55
0
 def run_tests(self):
     # import tox here, because outside the eggs aren't loaded yet
     import tox
     errno = tox.cmdline(self.test_args)
     sys.exit(errno)
예제 #56
0
def test_tox_cmdline_args():
    with pytest.raises(SystemExit):
        tox.cmdline(["caller_script", "--help"])
예제 #57
0
 def run_tests(self):
     import tox  # Import here, because outside eggs aren't loaded.
     import shlex
     sys.exit(tox.cmdline(args=shlex.split(self.tox_args)))
예제 #58
0
def test_tox_cmdline_args():
    with pytest.raises(SystemExit):
        tox.cmdline(['caller_script', '--help'])
예제 #59
0
def test_tox_cmdline_no_args(monkeypatch, initproj):
    initproj("help", filedefs={"tox.ini": ""})
    monkeypatch.setattr(sys, "argv", ["caller_script", "--help"])
    with pytest.raises(SystemExit):
        tox.cmdline()
예제 #60
0
 def run(cls):
     import tox
     sys.exit(tox.cmdline([]))