flesh out common code blocks in test/framework/options.py#2452
flesh out common code blocks in test/framework/options.py#2452boegel merged 8 commits intoeasybuilders:developfrom
Conversation
| self.assertTrue(app.installdir.endswith('software/toy/0.0')) | ||
|
|
||
| def _assert_regexs(self, regexs, txt, assert_true=True): | ||
| for regex in regexs: |
There was a problem hiding this comment.
@migueldiascosta Please include a docstring when adding methods
| else: | ||
| self.assertFalse(regex.search(txt), "Pattern '%s' NOT found in: %s" % (regex.pattern, txt)) | ||
|
|
||
| def _run_mock_eb(self, args, stdout=True, stderr=False, do_build=False, raise_error=False, verbose=False, testing=False, strip=False): |
There was a problem hiding this comment.
@migueldiascosta Please include a docstring when adding methods
There was a problem hiding this comment.
Also, why not always mock both stdout and stderr?
I would remove the stdout & stderr named arguments in this method, and always mock & return both?
| self.mock_stdout(False) | ||
| self.mock_stderr(False) | ||
| stdout, stderr = self._run_mock_eb(args, do_build=True, raise_error=True, verbose=True, strip=True) | ||
| self.assertEqual(stdout, '') |
There was a problem hiding this comment.
@boegel this is failing, but I don't understand, why should stdout be empty?
It doesn't fail without the new helper method, so I must be missing something...
|
@migueldiascosta With So, you can fix this by using |
|
@boegel yes, I had noticed that just now, sorry about that :) |
|
inverting the default behaviour was not a brilliant idea... |
|
@migueldiascosta I agree, it's probably better to use |
|
@boegel you mean |
|
@migueldiascosta Yes, I just confirmed my own statement. I indeed mean No |
|
Thanks for the effort @migueldiascosta! |
No description provided.