Enable reuse of launch testing functionality#236
Merged
Conversation
This was referenced May 15, 2019
pbaughman
reviewed
May 15, 2019
| elif hasattr(expected_output, 'search'): | ||
| return lambda expected, actual: ( | ||
| expected.match(actual.replace(os.linesep, '\n')) is not None | ||
| expected.search(actual.replace(os.linesep, '\n')) is not None |
Contributor
There was a problem hiding this comment.
I encountered this same issue while trying to improve the test coverage on launch_testing. A simple test that catches this issue and prevents regression would be something like
def test_works_with_regex(self):
assertInStdout(
self.proc_output,
re.compile(r'Called with arguments \S+'),
'terminating_proc-2'
)
You can add it to the bottom of test_io_handler_and_assertions.py You'll also need to import re at the top
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
…nStdout Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
0d6686c to
69ab824
Compare
wjwwood
approved these changes
May 16, 2019
jacobperron
added a commit
that referenced
this pull request
May 18, 2019
This reverts commit 7329a3e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connected to ros2/ros_testing#1. This pull request enables reuse of the
launch_testCLI andadd_launch_testCMake macro functionality, to be leveraged by theros2testandros_testingpackages.Incidentally, a bug was found during the testing phase and thus this PR includes a fix for it, in it's own separate commit.