File: run_failure.py

package info (click to toggle)
kazoo 2.10.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,048 kB
  • sloc: python: 10,148; makefile: 181; sh: 109
file content (28 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys


def test(arg):
    return os.system("bin/pytest -v %s" % arg)


def main(args):
    if not args:
        print(
            "Run as bin/python run_failure.py <test>, for example: \n"
            "bin/python run_failure.py "
            "kazoo.tests.test_watchers:KazooChildrenWatcherTests"
        )
        return
    arg = args[0]
    i = 0
    while 1:
        i += 1
        print("Run number: %s" % i)
        ret = test(arg)
        if ret != 0:
            break


if __name__ == "__main__":
    main(sys.argv[1:])