Skip to content

Commit bde5676

Browse files
committed
test(conftest): check error messages in assert_complete()
Now assert_complete() checks that no error messages are output while the completion.
1 parent a00b719 commit bde5676

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/t/conftest.py

+5
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ def assert_complete(
765765
r"^" + re.escape(MAGIC_MARK),
766766
# 2: on same line, result in .match
767767
r"^([^\r]+)%s$" % re.escape(MAGIC_MARK),
768+
# 3: error messages
769+
r"^([^\r].*)%s$" % re.escape(MAGIC_MARK),
768770
pexpect.EOF,
769771
pexpect.TIMEOUT,
770772
]
@@ -777,6 +779,9 @@ def assert_complete(
777779
elif got == 2:
778780
output = bash.match.group(1)
779781
return CompletionResult(output)
782+
elif got == 3:
783+
output = bash.match.group(1)
784+
raise AssertionError("Unexpected output: [%s]" % output)
780785
else:
781786
# TODO: warn about EOF/TIMEOUT?
782787
return CompletionResult()

0 commit comments

Comments
 (0)