def instart(cls, name, display_name=None, stay_alive=True):
    cls._svc_name_ = name
    cls._svc_display_name_ = display_name or name
    try:
        module_path = modules[cls.__module__].__file__
    except AttributeError:
        # maybe py2exe went by
        from sys import executable
        module_path = executable
    module_file = splitext(abspath(module_path))[0]
    cls._svc_reg_class_ = '{0}.{1}'.format(module_file, cls.__name__)
    if stay_alive:
        win32api.SetConsoleCtrlHandler(lambda x: True, True)
    try:
        win32serviceutil.InstallService(
                cls._svc_reg_class_,
                cls._svc_name_,
                cls._svc_display_name_,
                startType=win32service.SERVICE_AUTO_START
                )
        print('Install ok')
        win32serviceutil.StartService(
                cls._svc_name_
                )
        print('Start ok')
    except Exception as err:
        print(str(err))
Test exact number of tests when test class extends JUnit TestCase
dataset/ETHPy150Open saltstack/salt/salt/utils/winservice.py/instart--crossover with--dataset/ETHPy150Open Blazemeter/taurus/tests/modules/test_SeleniumExecutor.py/TestSeleniumStuff.test_samples_count_testcase