implement 'stderr_match' like 'stdout_match'
This commit is contained in:
parent
79be5a3a87
commit
35c6425a44
@ -216,13 +216,10 @@ class Result:
|
|||||||
expect = ExpectPattern(self, pattern, encoding)
|
expect = ExpectPattern(self, pattern, encoding)
|
||||||
expect.check("stdout_match", self._stdout)
|
expect.check("stdout_match", self._stdout)
|
||||||
|
|
||||||
def stderr_match(self, pattern):
|
def stderr_match(self, pattern, encoding='utf-8'):
|
||||||
self._checked_stderr = True
|
self._checked_stderr = True
|
||||||
lines = self._stderr.lines()
|
expect = ExpectPattern(self, pattern, encoding)
|
||||||
for line in lines:
|
expect.check("stderr_match", self._stderr)
|
||||||
if re.search(pattern, line):
|
|
||||||
return
|
|
||||||
self._error("stderr_match", actual=Lines(lines), expect=Regexp(pattern))
|
|
||||||
|
|
||||||
def stdout_equal(self, content, encoding='utf-8'):
|
def stdout_equal(self, content, encoding='utf-8'):
|
||||||
self._checked_stdout = True
|
self._checked_stdout = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user