Commit 901581b8 authored by Guido Günther's avatar Guido Günther

doctest: Use C locale when parsing command output

Otherwise we fail when run in a non C locale
parent 6a5675cb
......@@ -169,12 +169,14 @@ class Command(object):
Traceback (most recent call last):
...
CommandExecFailed: execution failed: ...
>>> c = Command("/bin/true", capture_stdout=True)
>>> c = Command("/bin/true", capture_stdout=True,
... extra_env={'LC_ALL': 'C'})
>>> c.call(["--version"])
0
>>> c.stdout.decode('utf-8').startswith('true')
True
>>> c = Command("/bin/false", capture_stdout=True)
>>> c = Command("/bin/false", capture_stdout=True,
... extra_env={'LC_ALL': 'C'})
>>> c.call(["--help"])
1
>>> c.stdout.decode('utf-8').startswith('Usage:')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment