test-systemd-tmpfiles: skip on python3.4

python3.4 is used by our CI.
Let's revert this when we stop supporting python < 3.5.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-12-02 14:00:58 +01:00
parent 03025f46af
commit 7488492a81
1 changed files with 9 additions and 3 deletions

View File

@ -21,15 +21,21 @@ except ImportError:
id128 = None
EX_DATAERR = 65 # from sysexits.h
EXIT_TEST_SKIP = 77
try:
subprocess.run
except AttributeError:
sys.exit(EXIT_TEST_SKIP)
exe = sys.argv[1]
def test_line(line, *, user, returncode=EX_DATAERR, extra={}):
args = ['--user'] if user else []
print('Running {} {} on {!r}'.format(exe, ' '.join(args), line))
c = subprocess.run([exe, '--create', *args, '-'],
**extra,
input=line, stdout=subprocess.PIPE, universal_newlines=True)
c = subprocess.run([exe, '--create', '-'] + args,
input=line, stdout=subprocess.PIPE, universal_newlines=True,
**extra)
assert c.returncode == returncode, c
def test_invalids(*, user):