• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / zdaemon / 12825577578

17 Jan 2025 08:41AM UTC coverage: 79.914% (-0.08%) from 79.992%
12825577578

Pull #37

github

web-flow
Trigger CI
Pull Request #37: Update Python version support.

361 of 512 branches covered (70.51%)

Branch coverage included in aggregate %.

5 of 15 new or added lines in 5 files covered. (33.33%)

5 existing lines in 4 files now uncovered.

1676 of 2037 relevant lines covered (82.28%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/zdaemon/tests/parent.py
1
import os
×
2
import sys
×
3
import time
×
4

5

6
donothing_contents = """\
×
7
#!/bin/sh
8
while [ "1" -ne "2" ]; do
9
   sleep 10
10
done
11
"""
12

13

14
def main():
×
15
    # dummy zdctl startup of zdrun
16
    shutup()
×
17
    file = os.path.normpath(os.path.abspath(sys.argv[0]))
×
18
    tmp = sys.argv[1]
×
19
    dir = os.path.dirname(file)
×
20
    zctldir = os.path.dirname(dir)
×
21
    zdrun = os.path.join(zctldir, 'zdrun.py')
×
22
    donothing = os.path.join(tmp, 'donothing.sh')
×
23
    fd = os.open(donothing, os.O_WRONLY | os.O_CREAT, 0o700)
×
24
    os.write(fd, donothing_contents.encode())
×
25
    os.close(fd)
×
26
    args = [sys.executable, zdrun]
×
27
    args += ['-d', '-b', '10', '-s', os.path.join(tmp, 'testsock'),
×
28
             '-x', '0,2', '-z', dir, donothing]
29
    flag = os.P_NOWAIT
×
30
    os.spawnvpe(flag, args[0], args,
×
31
                dict(os.environ, PYTHONPATH=':'.join(sys.path)),
32
                )
UNCOV
33
    while True:
×
34
        # wait to be signaled
35
        time.sleep(1)
×
36

37

38
def shutup():
×
39
    os.close(0)
×
40
    sys.stdin = sys.__stdin__ = open("/dev/null")
×
41
    try:  # PEP 446, Python >= 3.4
×
42
        os.set_inheritable(sys.stdin.fileno(), True)
×
43
    except AttributeError:
×
44
        pass
×
45
    os.close(1)
×
46
    sys.stdout = sys.__stdout__ = open("/dev/null", "w")
×
47
    try:  # PEP 446, Python >= 3.4
×
48
        os.set_inheritable(sys.stdout.fileno(), True)
×
49
    except AttributeError:
×
50
        pass
×
51
    os.close(2)
×
52
    sys.stderr = sys.__stderr__ = open("/dev/null", "w")
×
53
    try:  # PEP 446, Python >= 3.4
×
54
        os.set_inheritable(sys.stderr.fileno(), True)
×
55
    except AttributeError:
×
56
        pass
×
57

58

59
if __name__ == '__main__':
60
    main()
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc