File: example_script.py

package info (click to toggle)
pytest-subprocess 1.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 444 kB
  • sloc: python: 2,319; makefile: 17
file content (19 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""An example script to test subprocess."""

import sys
import time

print("Stdout line 1")
print("Stdout line 2")
if "stderr" in sys.argv:
    print("Stderr line 1", file=sys.stderr)

if "wait" in sys.argv:
    time.sleep(0.5)

if "non-zero" in sys.argv:
    sys.exit(1)

if "input" in sys.argv:
    user_input = input("Provide an input: ")
    print("Provided:", user_input)