python类main()的实例源码

setup.py 文件源码 项目:poco 作者: shiwaforce 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def run(self):
        import pytest
        rcode = pytest.main(self.test_args)
        sys.exit(rcode)
setup.py 文件源码 项目:h1-python 作者: uber-common 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def run_tests(self):
        import pytest
        errcode = pytest.main(self.test_args)
        sys.exit(errcode)
setup.py 文件源码 项目:dractor 作者: VerizonDigital 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def run_tests(self):
        """Customized run"""

        # deferred import
        import pytest

        # run pytest with empty array so pytest.ini takes complete control
        # need to use [] because of https://github.com/pytest-dev/pytest/issues/1110
        errno = pytest.main([])
        sys.exit(errno)


#
# Main logic
#
setup.py 文件源码 项目:errcron 作者: attakei 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)
setup.py 文件源码 项目:wsstat 作者: Fitblip 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def run_tests(self):
        import pytest
        errcode = pytest.main(self.test_args)
        sys.exit(errcode)
setup.py 文件源码 项目:thorn 作者: robinhood 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def run_tests(self):
        import pytest
        sys.exit(pytest.main(self.pytest_args))
setup.py 文件源码 项目:formatizer 作者: fgimian 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def run_tests(self):
        # Import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)


# Read the long description from readme.rst
setup.py 文件源码 项目:octoconf 作者: andras-tim 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def run_tests(self):
        import pytest
        exit_code = pytest.main(self.pytest_args)
        sys.exit(exit_code)
setup.py 文件源码 项目:python-ceph-cfg 作者: oms4suse 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def run_tests(self):
        import shlex
        #import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(shlex.split(self.pytest_args))
        sys.exit(errno)
setup.py 文件源码 项目:chrome-prerender 作者: bosondata 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def run_tests(self):
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)
pytester.py 文件源码 项目:hostapd-mana 作者: adde88 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def pytest_addoption(parser):
    # group = parser.getgroup("pytester", "pytester (self-tests) options")
    parser.addoption('--lsof',
           action="store_true", dest="lsof", default=False,
           help=("run FD checks if lsof is available"))

    parser.addoption('--runpytest', default="inprocess", dest="runpytest",
           choices=("inprocess", "subprocess", ),
           help=("run pytest sub runs in tests using an 'inprocess' "
                 "or 'subprocess' (python -m main) method"))
pytester.py 文件源码 项目:hostapd-mana 作者: adde88 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def inline_genitems(self, *args):
        """Run ``pytest.main(['--collectonly'])`` in-process.

        Retuns a tuple of the collected items and a
        :py:class:`HookRecorder` instance.

        This runs the :py:func:`pytest.main` function to run all of
        pytest inside the test process itself like
        :py:meth:`inline_run`.  However the return value is a tuple of
        the collection items and a :py:class:`HookRecorder` instance.

        """
        rec = self.inline_run("--collect-only", *args)
        items = [x.item for x in rec.getcalls("pytest_itemcollected")]
        return items, rec
setup.py 文件源码 项目:uniq 作者: CiscoDevNet 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def run_tests(self):
        #import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)
setup.py 文件源码 项目:http 作者: grappa-py 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)
setup.py 文件源码 项目:bencoder.pyx 作者: whtsky 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def run_tests(self):
        #import here, cause outside the eggs aren't loaded
        import coverage
        cov = coverage.Coverage()
        cov.start()

        import pytest
        errno = pytest.main(self.pytest_args)

        cov.stop()
        cov.save()
        sys.exit(errno)
setup.py 文件源码 项目:pyprometheus 作者: Lispython 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)
__init__.py 文件源码 项目:pushkin 作者: Nordeus 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def run_tests():
    import pytest
    pytest.main(tests_directory_path)
    create_database()
testlauncher.py 文件源码 项目:pythonVSCode 作者: DonJayamanne 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main():
    import os
    import sys
    from ptvsd.visualstudio_py_debugger import DONT_DEBUG, DEBUG_ENTRYPOINTS, get_code
    from ptvsd.attach_server import DEFAULT_PORT, enable_attach, wait_for_attach

    sys.path[0] = os.getcwd()
    os.chdir(sys.argv[1])
    secret = sys.argv[2]
    port = int(sys.argv[3])
    testFx = sys.argv[4]
    args = sys.argv[5:]    

    DONT_DEBUG.append(os.path.normcase(__file__))
    DEBUG_ENTRYPOINTS.add(get_code(main))

    enable_attach(secret, ('127.0.0.1', port), redirect_output = False)
    sys.stdout.flush()
    print('READY')
    sys.stdout.flush()
    wait_for_attach()

    try:
        if testFx == 'pytest':
            import pytest
            pytest.main(args)
        else:
            import nose
            nose.run(argv=args)
        sys.exit()
    finally:
        pass
tasks.py 文件源码 项目:django-include 作者: chrisseto 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def test(ctx, watch=False, last_failing=False):
    """Run the tests.

    Note: --watch requires pytest-xdist to be installed.
    """
    import pytest
    flake(ctx)
    args = []
    if watch:
        args.append('-f')
    if last_failing:
        args.append('--lf')
    retcode = pytest.main(args)
    sys.exit(retcode)


问题


面经


文章

微信
公众号

扫码关注公众号