summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
blob: a2b094e2fcad2d9975f0b2dda1e5e8e1531c3348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
"""Assert no TTY is available."""

import sys

status = 0

for handle in sys.stdin, sys.stdout, sys.stderr:
    if handle.isatty():
        print(f'{handle} is a TTY', file=sys.stderr)
        status += 1

sys.exit(status)